<%= stylesheet_link_tag 'wk-time', :plugin => "redmine_wktime" %>
<div class="autoscroll">
<table class="list time-entries">
  <thead>
         <tr>
				<%= sort_header_tag('asset_name', :caption => l(:label_asset), class: "lbl-txt-align") %>
				<%= sort_header_tag('product_name', :caption => l(:label_product), class: "lbl-txt-align") %>
				<%= sort_header_tag('purchase_date', :caption => l(:label_purchase_date), class: "lbl-txt-align") %>
				<th class="lbl-txt-align"><%= l(:label_purchase_value) %></th>
				<%= sort_header_tag('previous_value', :caption => l(:label_previous_value), class: "lbl-txt-align") %>
				<%= sort_header_tag('depreciation_date', :caption => l(:label_depreciation_date), class: "lbl-txt-align") %>
				<%= sort_header_tag('depreciation', :caption => l(:label_depreciation), class: "lbl-txt-align") %>
				<th class="lbl-txt-align"><%= l(:label_current_value) %></th>
				<th></th>
         </tr>
  </thead>
   <tbody>
   <% @depreciation_entries.each do |entry| %>
		 <tr>
				<td class="lbl-txt-align"><%=h entry.asset_name %></td>
				<td class="lbl-txt-align"><%=h entry.product_name %></td>
				<td class="lbl-txt-align"><%=h entry.purchase_date %></td>
				<td class="lbl-txt-align"><%=h html_hours("%.2f" % (entry.cost_price.to_f + entry.over_head_price.to_f)) %></td>
				<td class="lbl-txt-align"><%=h html_hours("%.2f" % entry.actual_amount) %></td>
				<td class="lbl-txt-align"><%=h entry.depreciation_date %></td>
				<td class="lbl-txt-align"><%=h html_hours("%.2f" % entry.depreciation_amount) %></td>
				<td class="lbl-txt-align"><%=h html_hours("%.2f" % (entry.actual_amount.to_f - entry.depreciation_amount.to_f) ) %></td>
				<td align="center">
					<%= link_to image_tag('edit.png'), {:controller => controller.controller_name, :action => 'edit', :depreciation_id => entry.id, id: entry.id, :tab => controller.controller_name},
										   :title => l(:button_edit) %>
					<% if controller.hasDeletePermission %>
						<%= link_to image_tag('delete.png'), {:controller => controller.controller_name, :action => 'destroy', :depreciation_id => entry.id, id: entry.id, :tab => controller.controller_name},  :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
					<% end %>
				</td>
		</tr>
	<% end %>
   </tbody>
</table>
</div>
<span class="pagination"><%= pagination_links_full @entry_pages, @entry_count %></span>
