From bef015f4eacd6bb050fc966e9fd07e188b51ab45 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Thu, 21 Oct 2010 11:10:13 -0700 Subject: [PATCH] [#4674] Round calculated Overhead Budget hours to two places --- lib/redmine_contracts/budget_plugin_migration.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/redmine_contracts/budget_plugin_migration.rb b/lib/redmine_contracts/budget_plugin_migration.rb index 7514a90..63e5260 100644 --- a/lib/redmine_contracts/budget_plugin_migration.rb +++ b/lib/redmine_contracts/budget_plugin_migration.rb @@ -161,7 +161,6 @@ module RedmineContracts def self.convert_overhead(deliverable, old_deliverable, total) total ||= 0 - if old_deliverable['overhead'].present? if @overhead_rate != 0 hours = old_deliverable['overhead'] / @overhead_rate @@ -171,7 +170,7 @@ module RedmineContracts deliverable.overhead_budgets << OverheadBudget.new(:deliverable => deliverable, :budget => old_deliverable['overhead'], - :hours => hours) + :hours => hours.to_f.round(2)) elsif old_deliverable['overhead_percent'].present? overhead = total * (old_deliverable['overhead_percent'].to_f / 100) if @overhead_rate != 0 @@ -182,7 +181,7 @@ module RedmineContracts deliverable.overhead_budgets << OverheadBudget.new(:deliverable => deliverable, :budget => overhead, - :hours => hours) + :hours => hours.to_f.round(2)) end end