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
2008-06-19 15:29:02 -07:00
parent 5431df3d8d
commit b776098c7d
7 changed files with 37 additions and 14 deletions
+8 -3
View File
@@ -17,8 +17,13 @@ describe FixedDeliverable, '.spent' do
end
describe FixedDeliverable, '.profit as a %' do
it 'should return the % of the fixed bid amount' do
@deliverable = FixedDeliverable.new({ :subject => 'test', :profit_percent => 50, :fixed_cost => 1000.0 })
@deliverable.profit.should eql(500.0)
it 'should return the % of the fixed bid and overhead amount' do
@deliverable = FixedDeliverable.new({ :subject => 'test', :profit_percent => 50, :fixed_cost => 1000.0, :overhead => "1000.00", :overhead_percent => nil })
@deliverable.profit.should eql(1000.0)
end
it 'should return the % of the fixed bid and overhead percentage' do
@deliverable = FixedDeliverable.new({ :subject => 'test', :profit_percent => 50, :fixed_cost => 1000.0, :overhead => nil, :overhead_percent => 100 })
@deliverable.profit.should eql(1000.0)
end
end