git-svn-id: https://192.168.0.254/svn/Rodax.redmine_rodax_crm/trunk@4 ff88604e-da85-c949-a72f-fc3aa3ba3724
26 lines
1.2 KiB
Plaintext
26 lines
1.2 KiB
Plaintext
<% if contract_statuses.any? %>
|
|
<div id="contracts_statistics">
|
|
<% if !(@project && !authorize_for(:sale_funel, :index)) %>
|
|
<div class="contextual">
|
|
<%= link_to l(:label_sale_funel), {:controller => 'sale_funel', :action => 'index', :project_id => @project} %>
|
|
</div>
|
|
<% end %>
|
|
<h3><%= l(:label_statistics) %></h3>
|
|
<table class="contracts_statistics">
|
|
<% contract_statuses.each do |contract_status| %>
|
|
<tr>
|
|
<td>
|
|
<span class="contract-status" style=<%= "background-color:#{contract_status.color_name};color:white;" %> >
|
|
<%= h "#{contract_status.name}(#{@project ? @project.contracts.count(:conditions => {:status_id => contract_status.id}) : Contract.count(:conditions => {:status_id => contract_status.id})})" %>
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<strong>
|
|
<%= @project ? contracts_sum_to_currency(@project.contracts.sum(:price, :conditions => {:status_id => contract_status.id}, :group => :currency)) : contracts_sum_to_currency(Contract.sum(:price, :conditions => {:status_id => contract_status.id}, :group => :currency)) %>
|
|
</strong>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</table>
|
|
</div>
|
|
<% end %> |