<% if deal_statuses.any? %>
	<div id="deals_statistics">
		<div class="contextual">
			<%= link_to l(:label_crm_sales_funnel), {:controller => 'deals', :action => 'index', :project_id => @project, :deals_list_style => 'list_pipeline'} %>
		</div>
		<h3><%= l(:label_crm_statistics) %></h3>
		<table class="deals_statistics">
			<% deal_statuses.each do |deal_status| %>
			<tr>
				<td>
					<span class="tag-label-color" style=<%= "background-color:#{deal_status.color_name};color:white;" %> >
						<%= link_to "#{deal_status.name}(#{@project ? @project.deals.visible.with_status(deal_status.id).count : Deal.visible.with_status(deal_status.id).count})".html_safe, deal_status_url(deal_status.id, :project_id => @project) %>
					</span>
				</td>
				<td>
					<strong>
						<%= prices_collection_by_currency(Deal.by_project(@project).visible.where(:status_id => deal_status.id).group(:currency).sum(:price), :hide_zeros => true).join(' / ').html_safe %>
					</strong>
				</td>
			</tr>
			<% end %>
		</table>
	</div>
<% end %>
