Changed profit to take into account the overhead along with the total labor cost

when profit is a %

* Fixed Models
* Fixed JS Calculator
* Cleaned up specs to access attributes directly

  #1349
This commit is contained in:
Eric Davis committed 2008-06-19 15:29:02 -07:00
1 parent 5431df3d8d
commit b776098c7d
7 files changed
+37 -14

No files matched your search

+8 -3
View File
@@ -28,8 +28,13 @@ describe HourlyDeliverable, '.spent' do
end
describe HourlyDeliverable, '.profit as a %' do
it 'should return the % of the hours mutipled by the cost per hour amount' do
@deliverable = HourlyDeliverable.new({ :subject => 'test', :profit_percent => 50, :cost_per_hour => 100.0, :total_hours => 10 })
@deliverable.profit.should eql(500.0)
it 'should return the % of the hours mutipled by the cost per hour amount plus the overhead' do
@deliverable = HourlyDeliverable.new({ :subject => 'test', :profit_percent => 50, :cost_per_hour => 100.0, :total_hours => 10, :overhead => '1000.00', :overhead_percent => nil })
@deliverable.profit.should eql(1000.0)
end
it 'should return the % of the hours mutipled by the cost per hour amount plus the overhead percentage' do
@deliverable = HourlyDeliverable.new({ :subject => 'test', :profit_percent => 50, :cost_per_hour => 100.0, :total_hours => 10, :overhead => nil, :overhead_percent => 100 })
@deliverable.profit.should eql(1000.0)
end
end