From 710773255ee3fe02e5d9df415c3d9cd1d822f24b Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 13 Jun 2013 17:05:31 +0200 Subject: [PATCH] Fixed from global start time to local start time. --- app/models/ticket.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/ticket.rb b/app/models/ticket.rb index 088b1928f..bbf211a10 100644 --- a/app/models/ticket.rb +++ b/app/models/ticket.rb @@ -750,7 +750,7 @@ class Ticket < ApplicationModel # get initial state and time if !last_state last_state = history_item['value_from'] - last_state_change = self.created_at + last_state_change = start_time end # use time if ticket got from e. g. open to pending @@ -811,9 +811,9 @@ class Ticket < ApplicationModel # if we have not had any state change if !last_state_change if sla_selected - diff = TimeCalculation.business_time_diff( self.created_at, end_time, sla_selected.data, sla_selected.timezone) + diff = TimeCalculation.business_time_diff( start_time, end_time, sla_selected.data, sla_selected.timezone) else - diff = TimeCalculation.business_time_diff( self.created_at, end_time ) + diff = TimeCalculation.business_time_diff( start_time, end_time ) end puts 'Diff state has not changed ' + diff.to_s total_time_without_pending = total_time_without_pending + diff