[#4477] Added the total FixedBudget markup to the deliverable details

This commit is contained in:
Eric Davis
2010-09-17 13:43:35 -07:00
parent ed7536897e
commit 081df7874d
2 changed files with 24 additions and 1 deletions
+7 -1
View File
@@ -72,7 +72,13 @@
</tr>
<% end %>
<%# TODO: Release 2, Markup %>
<tr>
<td class="l"><%= l(:field_markup) %></td>
<td class="fixed_markup_budget_spent">0</td>
<td class="fixed_markup_budget_total"><%= h(format_value_field_for_contracts(deliverable.fixed_markup_budget_total(period))) %></td>
<td></td>
</tr>
<tr>
<td class="l">Profit</td>
<td><%= h(format_value_field_for_contracts(deliverable.profit_left(period))) %></td>
+17
View File
@@ -254,6 +254,23 @@ class ContractsShowTest < ActionController::IntegrationTest
end
should "show the total fixed markup budget in the details for the Deliverable" do
@manager = User.generate!
@deliverable1 = FixedDeliverable.generate!(:contract => @contract, :manager => @manager)
@budget1 = FixedBudget.generate!(:deliverable => @deliverable1, :title => 'Item 1', :budget => '$1,000', :markup => '$100')
@budget2 = FixedBudget.generate!(:deliverable => @deliverable1, :title => 'Item 2', :budget => '$2,000', :markup => '200%')
visit_contract_page(@contract)
assert_select "table#deliverables" do
assert_select "#deliverable_details_#{@deliverable1.id}" do
assert_select 'td.fixed_markup_budget_spent', :text => '0'
assert_select 'td.fixed_markup_budget_total', :text => '4,100'
end
end
end
should "show the current period for a Retainer" do
today_mock = Date.new(2010,2,15)
Date.stubs(:today).returns(today_mock)