Files
redmine_contracts/app/views/contracts/show.html.erb
2011-08-08 11:48:35 -07:00

230 lines
10 KiB
Plaintext

<%= render :partial => 'title', :locals => {:contract => resource} %>
<% if resource.orphaned_time && resource.orphaned_time > 0 %>
<div class="error_msg">
<p>
<%= l(:text_error_message_orphaned_time, :amount => format_value_field_for_contracts(resource.orphaned_time, :unit => '$')) %>
<%= link_to_issue_list_with_filter(l(:text_error_message_update_orphaned_time), :deliverable_id => '!*') %>
</p>
</div>
<% end %>
<% div_for(resource) do %>
<%= avatar(resource.account_executive, :size => 40) %>
<div class="c_overview">
<table class="left">
<%= show_field(resource, :status, :html_options => {:class => 'contract-status'}) %>
<%= show_field(resource, :account_executive, :html_options => {:class => 'contract-account-manager'}) %>
<tr class="contract-type">
<%# show_field(resource, :contract_type, :html_options => {:class => 'contract-type'}) %>
<td colspan="2"><%= release(5, "Contract type") %></td>
</tr>
</table>
<table class="middle">
<%= show_field(resource, :start_date, :format => :format_date, :html_options => {:class => 'contract-start-date'}) %>
<%= show_field(resource, :end_date, :format => :format_date, :html_options => {:class => 'contract-end-date'}) %>
</table>
<table class="right">
<%= show_budget_field(resource, :labor_spent, :labor_budget, :format => :format_value_field_for_contracts, :html_options => {:class => 'contract-labor'}, :label_html_options => {:width => '49%'}) %>
<%= show_budget_field(resource, :overhead_spent, :overhead_budget, :format => :format_value_field_for_contracts, :html_options => {:class => 'contract-overhead'}) %>
<%= show_budget_field(resource, :total_spent, :total_budget, :format => :format_value_field_for_contracts, :html_options => {:class => 'contract-total'}) %>
</table>
<div class="clear"></div>
<a href="#" id="expand_terms" class="expand"><%= l(:text_terms_and_financial_overview) %></a>
<div id="contract-terms">
<div class="left">
<table class="info">
<%= show_field(resource, :client_point_of_contact, :format => :textilizable, :raw => true, :html_options => {:class => 'contract-client-point-of-contact padd wiki'}, :label_html_options => {:width => '25%'}) %>
<%= show_field(resource, :executed, :format => :format_as_yes_or_no, :html_options => {:class => 'contract-executed'}) %>
<%= show_field(resource, :discount_note, :format => :textilizable, :raw => true, :html_options => {:class => 'contract-discount-note wiki'}) %>
<%= show_field(resource, :payment_term, :format => :format_payment_terms, :html_options => {:class => 'contract-payment-terms'}) %>
<%= show_field(resource, :client_ap_contact_information, :format => :textilizable, :raw => true, :html_options => {:class => 'contract-client-ap-contact-information wiki'}) %>
<%= show_field(resource, :po_number, :html_options => {:class => 'contract-po-number'}) %>
<%= show_field(resource, :details, :format => :textilizable, :raw => true, :html_options => {:class => 'contract-details wiki'}) %>
</table>
</div>
<table class="finance">
<%= show_budget_field(resource, :labor_spent, :labor_budget, :format => :format_value_field_for_contracts, :html_options => {:class => 'contract-labor'}, :label_html_options => {:width => '46%'}) %>
<%= show_budget_field(resource, :overhead_spent, :overhead_budget, :format => :format_value_field_for_contracts, :html_options => {:class => 'contract-overhead'}) %>
<%= show_budget_field(resource, :fixed_spent, :fixed_budget, :format => :format_value_field_for_contracts, :html_options => {:class => 'contract-fixed'}) %>
<% if show_markup_for?(resource) %>
<%= show_budget_field(resource, :fixed_markup_spent, :fixed_markup_budget, :format => :format_value_field_for_contracts, :html_options => {:class => 'contract-markup'}) %>
<% end %>
<%= show_budget_field(resource, :profit_spent, :profit_budget, :format => :format_value_field_for_contracts, :html_options => {:class => 'contract-profit'}) %>
<tr class="contract-discount">
<%# show_budget_field(resource, :discount_spent, :discount_budget, :format => :format_value_field_for_contracts, :html_options => {:class => 'contract-discount'}) %>
<td colspan="3"><%= release(4, "Discount") %></td>
</tr>
<tr>
<td colspan="3">
<div class="hr"></div>
</td>
</tr>
<%= show_budget_field(resource, :total_spent, :total_budget, :format => :format_value_field_for_contracts, :html_options => {:class => 'contract-total'}) %>
<%= show_budget_field(resource, :billable_rate, 'nil?', :format => :format_hourly_rate, :html_options => {:class => 'contract-billable-rate total'}) %>
<tr>
<td colspan="3">
<div class="hr"></div>
</td>
</tr>
<%= show_budget_field(resource, :labor_hour_spent, :labor_hour_budget, :format => :l_hours, :html_options => {:class => 'contract-labor-hour'}) %>
<%= show_budget_field(resource, :overhead_hour_spent, :overhead_hour_budget, :format => :l_hours, :html_options => {:class => 'contract-overhead-hour'}) %>
<%= show_budget_field(resource, :estimated_hour_spent, :estimated_hour_budget, :format => :l_hours, :html_options => {:class => 'contract-total-hour total'}) %>
<tr>
<td class="stretch" colspan="3">
<!-- Stretch table height -->
</td>
</tr>
</table>
<div class="clear"></div>
</div>
</div>
<div class="clear"></div>
<div id="deliverables">
<%= content_tag(:h3, l(:field_deliverable_plural)) %>
<div class="actions">
<a href="#TODO-release-2"><%= release(2, "CSV") %></a>
<a href="#TODO-release?"><%= release(5, "View All/Pagination") %></a>
<%= link_to(l(:button_add_new), new_contract_deliverable_path(@project, resource), :id => 'new-deliverable') %>
</div>
<div class="clear"></div>
<% if resource.deliverables.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% else %>
<table width="100%" class="texpand" id="deliverables">
<thead>
<tr>
<th><%= l(:field_end_date) %></th>
<th>&nbsp;</th>
<th><%= l(:field_title) %></th>
<th><%= l(:field_status) %></th>
<th><%= l(:field_manager) %></th>
<th colspan="2"><%= l(:field_labor) %></th>
<th colspan="2"><%= l(:field_overhead) %></th>
<th colspan="2"><%= l(:field_fixed) %></th>
</tr>
</thead>
<tbody>
<% resource.deliverables.each do |deliverable| %>
<% content_tag_for(:tr, deliverable, :class => 'click ' + cycle('even','')) do %>
<td width="10%" class="arrow end-date"><span><%= h format_date(deliverable.end_date) %></span></td>
<td width="2%" class="type"><%= h deliverable.short_type %></td>
<td width="25%" class="title"><%= h deliverable.title %></td>
<td width="15%"><%= release(5, "Deliverable status") %></td>
<td width="15%" class="manager"><%= h deliverable.manager.try(:name) %></td>
<%= format_budget_for_deliverable(deliverable, deliverable.labor_budget_spent, deliverable.labor_budget_total, :class => 'labor') %>
<%= format_budget_for_deliverable(deliverable, deliverable.overhead_spent, deliverable.overhead_budget_total, :class => 'overhead') %>
<%= format_budget_for_deliverable(deliverable, deliverable.fixed_budget_total_spent, deliverable.fixed_budget_total, :class => 'fixed') %>
<% end %>
<tr id="deliverable_details_<%= h(deliverable.id) %>" class="ign">
<%= render :partial => 'deliverables/details_row', :locals => {:deliverable => deliverable, :contract => resource, :period => deliverable.current_date} %>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<div class="clear"></div>
</div>
<% end %> <%# div_for(resource) %>
<p><%= release(4, "Milestones") %></p>
<!--
<div id="milestones">
<h3>Milestones</h3>
<div class="options">
<input type="checkbox" checked="checked" /> Event
<input type="checkbox" checked="checked" /> Financial
<input type="checkbox" checked="checked" /> Dependency
</div>
<div class="actions">
<a href="#">iCal</a>
<a href="#">View All (37)</a>
<a href="#" id="new-deliverable">Add New</a>
</div>
<div class="clear"></div>
<table>
<thead>
<tr>
<th class="c">Done</th>
<th>Date</th>
<th>Title</th>
<th>Status</th>
<th>Type</th>
<th>Alert</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td class="c"><input type="checkbox" value="1" /></td>
<td>11/19/2009</td>
<td>ACME delivers branding guide</td>
<td><span class="red"><strong>Overdue</strong></span></td>
<td>Dependency</td>
<td>1 day</td>
</tr>
<tr class="even">
<td class="c"><input type="checkbox" value="1" /></td>
<td>12/01/2009</td>
<td>Send Invoice #2</td>
<td><span class="red"><strong>Overdue</strong></span></td>
<td>Financial</td>
<td>EoD</td>
</tr>
<tr class="odd highlight">
<td class="c"><input type="checkbox" value="1" /></td>
<td>12/11/2009</td>
<td>QA Signoff on 1.2</td>
<td>Pending</td>
<td>Event</td>
<td>3 days</td>
</tr>
<tr class="even">
<td class="c"><input type="checkbox" value="1" /></td>
<td>12/15/2009</td>
<td>Release 1.2</td>
<td>Pending</td>
<td>Event</td>
<td></td>
</tr>
<tr class="odd">
<td class="c"><input type="checkbox" value="1" /></td>
<td>12/15/2009</td>
<td>Deliverable: Load and Release Software</td>
<td>Pending</td>
<td>Event</td>
<td>BoD</td>
</tr>
</tbody>
</table>
</div>
-->
<p><%= release(3, "history") %></p>
<% html_title "#{l(:text_contracts)} - #{h(resource.name)}" %>