83 lines
5.0 KiB
ERB
83 lines
5.0 KiB
ERB
<%# TODO: Need skinning %>
|
|
<% div_for(resource) do %>
|
|
<%= content_tag(:h2, h(resource.name)) %>
|
|
|
|
<%= show_field(resource, :status, :html_options => {:class => 'contract-status'}) %>
|
|
<%= show_field(resource, :account_executive, :html_options => {:class => 'contract-account-manager'}) %>
|
|
<%= show_field(resource, :contract_type, :html_options => {:class => 'contract-type'}) %>
|
|
<%= 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'}) %>
|
|
|
|
<%= show_budget_field(resource, :labor_spent, :labor_budget, :html_options => {:class => 'contract-labor'}) %>
|
|
<%= show_budget_field(resource, :overhead_spent, :overhead_budget, :html_options => {:class => 'contract-overhead'}) %>
|
|
<%= show_budget_field(resource, :total_spent, :total_budget, :html_options => {:class => 'contract-total'}) %>
|
|
|
|
<div id="contract-terms" style="border: 1px solid #000">
|
|
<%= show_field(resource, :client_point_of_contact, :format => :textilizable, :raw => true, :html_options => {:class => 'contract-client-point-of-contact'}) %>
|
|
<%= show_field(resource, :executed, :html_options => {:class => 'contract-executed'}) %>
|
|
<%= show_field(resource, :discount_note, :format => :textilizable, :raw => true, :html_options => {:class => 'contract-discount-note'}) %>
|
|
<%= show_field(resource, :payment_terms, :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'}) %>
|
|
<%= show_field(resource, :po_number, :html_options => {:class => 'contract-po-number'}) %>
|
|
<%= show_field(resource, :details, :format => :textilizable, :raw => true, :html_options => {:class => 'contract-details'}) %>
|
|
|
|
<div id="contract-finances" style="border: 1px solid #000">
|
|
<%= show_budget_field(resource, :labor_spent, :labor_budget, :html_options => {:class => 'contract-labor'}) %>
|
|
<%= show_budget_field(resource, :overhead_spent, :overhead_budget, :html_options => {:class => 'contract-overhead'}) %>
|
|
<%= show_budget_field(resource, :fixed_spent, :fixed_budget, :html_options => {:class => 'contract-fixed'}) %>
|
|
<%= show_budget_field(resource, :markup_spent, :markup_budget, :html_options => {:class => 'contract-markup'}) %>
|
|
<%= show_budget_field(resource, :profit_spent, :profit_budget, :html_options => {:class => 'contract-profit'}) %>
|
|
<%= show_budget_field(resource, :discount_spent, :discount_budget, :html_options => {:class => 'contract-discount'}) %>
|
|
<%= show_budget_field(resource, :total_spent, :total_budget, :html_options => {:class => 'contract-total'}) %>
|
|
|
|
<%= show_field(resource, :billable_rate, :format => :format_hourly_rate, :html_options => {:class => 'contract-billable-rate'}) %>
|
|
<%= show_budget_field(resource, :estimated_hour_spent, :estimated_hour_budget, :format => :l_hours, :html_options => {:class => 'contract-estimated-hour'}) %>
|
|
</div>
|
|
|
|
</div>
|
|
<% end %>
|
|
|
|
<%= link_to(l(:button_update), edit_contract_path(@project, resource)) %>
|
|
|
|
<%= link_to(l(:button_add_new), new_contract_deliverable_path(@project, resource), :id => 'new-deliverable') %>
|
|
|
|
<% if resource.deliverables.empty? %>
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
|
<% else %>
|
|
<table class="list" cellspacing="0" border="0" cellpadding="0" id="deliverables">
|
|
<thead>
|
|
<th><%= l(:field_end_date) %></th>
|
|
<th> </th>
|
|
<th><%= l(:field_title) %></th>
|
|
<%# TODO: Status %>
|
|
<th><%= l(:field_manager) %></th>
|
|
<th><%= l(:field_labor) %></th>
|
|
<th><%= l(:field_overhead) %></th>
|
|
<th><%= l(:field_fixed) %></th>
|
|
<th><%= l(:button_edit) %></th>
|
|
<th><%= l(:button_delete) %></th>
|
|
</thead>
|
|
<tbody>
|
|
<% resource.deliverables.each do |deliverable| %>
|
|
<% content_tag_for(:tr, deliverable) do %>
|
|
<td class="end-date"><%= h format_date(deliverable.end_date) %></td>
|
|
<td class="type"><%= h deliverable.short_type %></td>
|
|
<td class="title"><%= h deliverable.title %></td>
|
|
<%# TODO: Status %>
|
|
<td class="manager"><%= h deliverable.manager.try(:name) %></td>
|
|
<td class="labor">
|
|
<%= format_budget_for_deliverable(deliverable, deliverable.labor_budget_spent, deliverable.labor_budget_total) %>
|
|
</td>
|
|
<td class="overhead">
|
|
<%= format_budget_for_deliverable(deliverable, deliverable.overhead_spent, deliverable.overhead_budget_total) %>
|
|
</td>
|
|
<td class="fixed">---</td>
|
|
<td><%= link_to(l(:button_edit), edit_contract_deliverable_path(@project, resource, deliverable), :class => 'icon icon-edit') %></td>
|
|
<td><%= link_to(l(:button_delete), contract_deliverable_path(@project, resource, deliverable), :method => :delete, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') %></td>
|
|
|
|
<% end %>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% end %>
|