From 2e090df4e37403c9e030d40e9e695d8ce7bb448b Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Thu, 9 Sep 2010 13:50:08 -0700 Subject: [PATCH] [#4420] Allow an optional date param. Used by redmine_contracts. --- lib/overhead_deliverable_patch.rb | 2 +- lib/overhead_fixed_deliverable_patch.rb | 2 +- lib/overhead_hourly_deliverable_patch.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/overhead_deliverable_patch.rb b/lib/overhead_deliverable_patch.rb index e34ca31..bb87254 100644 --- a/lib/overhead_deliverable_patch.rb +++ b/lib/overhead_deliverable_patch.rb @@ -9,7 +9,7 @@ module OverheadDeliverablePatch module InstanceMethods # Cost of time logged to overhead activities - def overhead_spent + def overhead_spent(date=nil) time_logs = issues.collect(&:time_entries).flatten return time_logs.collect {|time_entry| diff --git a/lib/overhead_fixed_deliverable_patch.rb b/lib/overhead_fixed_deliverable_patch.rb index 53476ca..a137b14 100644 --- a/lib/overhead_fixed_deliverable_patch.rb +++ b/lib/overhead_fixed_deliverable_patch.rb @@ -10,7 +10,7 @@ module OverheadFixedDeliverablePatch module InstanceMethods # Amount of "billable" money spent on issues. Similar to +spent+ # but only billable time. - def labor_budget_spent + def labor_budget_spent(date=nil) return 0.0 if self.fixed_cost.nil? return self.fixed_cost unless self.issues.size > 0 diff --git a/lib/overhead_hourly_deliverable_patch.rb b/lib/overhead_hourly_deliverable_patch.rb index 4906ca2..5b52069 100644 --- a/lib/overhead_hourly_deliverable_patch.rb +++ b/lib/overhead_hourly_deliverable_patch.rb @@ -10,7 +10,7 @@ module OverheadHourlyDeliverablePatch module InstanceMethods # Amount of "billable" money spent on issues. Similar to +spent+ # but only billable time. - def labor_budget_spent + def labor_budget_spent(date=nil) return 0.0 unless self.issues.size > 0 total = 0.0