[#4183] Implemented Contract#profit_left.
This commit is contained in:
@@ -38,12 +38,6 @@ class Contract < ActiveRecord::Base
|
||||
define_method(mthd) { "TODO in later release" }
|
||||
end
|
||||
|
||||
[
|
||||
:profit_spent
|
||||
].each do |mthd|
|
||||
define_method(mthd) { "TODO" }
|
||||
end
|
||||
|
||||
# OPTIMIZE: N+1
|
||||
def labor_budget
|
||||
deliverables.inject(0) {|total, deliverable| total += deliverable.labor_budget_total }
|
||||
@@ -91,6 +85,12 @@ class Contract < ActiveRecord::Base
|
||||
deliverables.inject(0) {|total, deliverable| total += deliverable.profit_budget }
|
||||
end
|
||||
|
||||
# OPTIMIZE: N+1
|
||||
def profit_left
|
||||
deliverables.inject(0) {|total, deliverable| total += deliverable.profit_left }
|
||||
end
|
||||
alias_method :profit_spent, :profit_left
|
||||
|
||||
PaymentTerms = {
|
||||
:net_0 => :text_payment_terms_net_0,
|
||||
:net_15 => :text_payment_terms_net_15,
|
||||
|
||||
Reference in New Issue
Block a user