<%= javascript_include_tag 'index', :plugin => "redmine_wktime" %>
<%= form_tag({:controller => 'wkproductitem', :action => 'updateTransfer'}, :method => :post, :id => 'query_form') do %>
	<h2><b><%=l(:label_transfer) %></b></h2>
	<div id="product_item_form">
		<%=h hidden_field_tag('product_item_id', @transferItem.product_item_id) %>
		<%=h hidden_field_tag('transfer_item_id', @transferItem.id) %>
		<% productItem = @transferItem.product_item %>
		<div class="splitcontent">
			<div class="splitcontentleft">
				<fieldset class="box tabular">
					<legend><%=l(:label_product_item)%></legend>
					<table width='100%'>
						<tr>
							<th align="left" width='30%'><%= l(:label_product) %></th>
							<td align="left" width='70%'>
								<%=h productItem.product.name %>
							</td>
						</tr>
						<tr>
							<th align="left"><%= l(:label_brand) %></th>
							<td align="left">
								<%=h productItem.brand.name unless productItem.brand.blank?  %>
							</td>
						</tr>
						<tr>
							<th align="left"><%= l(:label_model) %></th>
							<td align="left">
								<%=h productItem.product_model.name unless productItem.product_model.blank? %>
							</td>
						</tr>
						<tr>
							<th align="left"><%= l(:label_part_number) %></th>
							<td align="left">
								<%=h productItem.part_number %>
							</td>
						</tr>
					</table>
				</fieldset>
			</div>
			<%= render :partial => 'wkproductitem/edit_inventory', locals: {invntItem: @transferItem, isTransfer: true}%>
		</div>
		<div class="splitcontent">
			<div class="splitcontentleft">
			<fieldset class="box tabular">
				<legend><%=l(:label_inventory)%></legend>
				<table width='100%'>
					<tr>
						<th align="left"><%= l(:label_serial_number) %></th>
						<td align="left">
							<%=h @transferItem.serial_number %>
						</td>
					</tr>
					<tr>
						<th align="left"><%= l(:field_currency) %></th>
						<td align="left">
							<%=h @transferItem.currency %>
						</td>
					</tr>
					<tr>
						<th align="left"><%= l(:label_cost_price) %></th>
						<td align="left">
							<%=h @transferItem.cost_price %>
						</td>
					</tr>
					<tr>
						<th align="left"><%= l(:label_over_head_price) %></th>
						<td align="left">
							<%=h @transferItem.over_head_price %>
						</td>
					</tr>
					<tr>
						<th align="left"><%= l(:label_selling_price) %></th>
						<td align="left">
							<%=h @transferItem.selling_price %>
						</td>
					</tr>
					<tr>
						<th align="left"><%= l(:label_available_quantity) %></th>
						<td align="left" >
							<%=h @transferItem.available_quantity %>
						</td>
					</tr>
					<tr>
						<th align="left"><%= l(:label_uom) %></th>
						<td align="left">
							<%=h @transferItem.uom.short_desc unless @transferItem.uom.blank? %>
						</td>
					</tr>
					<tr>
						<th align="left"><%= l(:field_location) %></th>
						<td align="left">
							<%=h @transferItem.location.blank? ? nil : @transferItem.location.name %>
						</td>
					</tr>
					<tr>
						<th align="left"><%= l(:field_notes) %></th>
						<td align="left"><%=h @transferItem.notes %></td>
					</tr>
				</table>
			</fieldset>
			</div>
			<div class="splitcontentright">
			</div>
		</div>
	</div>
	<div style="clear:left;"></div>
		<div align='center'>
			<%= submit_tag l(:label_transfer) ,:id => 'wkproductitem_transfer'%>
		</div>
<% end %>