From 318953bddfbcc106a7c0e30c91d37c96477d01f7 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 8 Nov 2024 17:44:09 -0700 Subject: [PATCH] Fix the destination summary when server using UTC Set the PHP time zone to fix the destination summary report. Without the time zone set it would use the server operating system time zone. If the time zone is set to UTC when it rolled over to a new date ahead of the local time zone it would make the report show 0 results. --- app/destinations/resources/classes/destinations.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/destinations/resources/classes/destinations.php b/app/destinations/resources/classes/destinations.php index 29b00b522c..60ba3b3084 100644 --- a/app/destinations/resources/classes/destinations.php +++ b/app/destinations/resources/classes/destinations.php @@ -1134,6 +1134,9 @@ if (!class_exists('destinations')) { $time_zone = date_default_timezone_get(); } + //set the time zone for php + date_default_timezone_set($time_zone); + //build the date range if (!empty($this->start_stamp_begin) || !empty($this->start_stamp_end)) { unset($this->quick_select); @@ -1236,6 +1239,7 @@ if (!class_exists('destinations')) { } $sql .= " and direction = 'inbound' \n"; $sql .= " and caller_destination is not null \n"; + $sql .= " leg = 'a' \n"; $sql .= $sql_date_range ?? ''; $sql .= ") as c \n";