
<style>
th{
  text-align: left;
}
.th, .td{
  text-align: left !important;
}
</style>
<% 	wkexpense_helper = Object.new.extend(WkexpenseHelper)
		itemType = controller.getItemType
%>
<%= hidden_field_tag('over_head_price', invntItem.over_head_price, id: 'transfer_over_head') if invntItem.present? && itemType == "I"%>
<%= hidden_field_tag('per_over_head', invntItem.over_head_price / invntItem&.total_quantity) if invntItem.present? && itemType == "I"%>
<%= hidden_field_tag('total_quantity', invntItem&.total_quantity, :name => "item_total_quantity") if itemType == "I"%>
<%= hidden_field_tag('available_quantity', 1) if params[:isAssemble].present? && itemType == "I" %>
<tr>
	<th><%= l(:field_currency) %></th>
	<td style="padding-left:40px;">
		<%=h select_tag("currency",options_for_select(wkexpense_helper.options_for_currency, :selected => invntItem.blank? ? Setting.plugin_redmine_wktime['wktime_currency'] : invntItem.currency), :disabled => isDisable || isTransfer) %>
	</td>
</tr>
<tr>
	<th><%= l(:label_cost_price) %></th>
	<td style="padding-left:40px;"><%= text_field_tag "cost_price",  invntItem.blank? ? '' : invntItem.cost_price, :disabled => isDisable || isTransfer %></td>
</tr>
<tr>
	<th><%= l(:label_over_head_price) %></th>
	<td style="padding-left:40px;"><%= text_field_tag "over_head_price",  invntItem.blank? ? '' : invntItem.over_head_price, :disabled => isDisable || isTransfer %></td>
</tr>
<tr>
	<th><%= l(:label_selling_price) %></th>
	<td style="padding-left:40px;"><%= text_field_tag "selling_price",  invntItem.blank? ? '' : invntItem.selling_price, :disabled => false %></td>
</tr>

<% if invntItem&.total_quantity.present? && itemType == "I" %>
	<tr>
		<th><%= l(:label_total_quantity) %></th>
		<td  style="padding-left:40px;" id="item_total_quantity">
			<%= invntItem&.total_quantity %>
		</td>
	</tr>
<% end %>

<tr>
	<th><%= l(itemType == "I" && invntItem.present? ? :label_available_quantity : :field_quantity) %></th>
	<td  style="padding-left:40px;" id="productItem">
		<%= (itemType == "I" && (params[:isAssemble] || @assembledComponent.present?)) ? '1' : (text_field_tag "available_quantity", ("%.2f" % invntItem.available_quantity unless invntItem.blank?), :disabled => isDisable && !isTransfer, :maxlength => 14) %>&nbsp;&nbsp;
    <%= link_to l(itemType == "I" ? :label_consumed_items : :label_used_items), "javascript:showQuantityDetails();" if invntItem.present? && !isTransfer %>
	</td>
</tr>

<tr>
	<th><%= l(:label_uom) %></th>
	<td style="padding-left:40px;">
		<%=h select_tag("uom_id", generic_options_for_select(WkMesureUnit, nil, 'short_desc', 'short_desc', 'id', invntItem.blank? ? '' : invntItem.uom_id, false), :disabled => isDisable && !isTransfer) %>
	</td>
</tr>

<script>
var title = "<%= l(:label_consumed_items) %>";
var details = "<%= l(:label_details) %>";
</script>
<div id="dialog"></div>