From e7cf2eca06c6fa2ad45d6d465dd404d8084dc95d Mon Sep 17 00:00:00 2001 From: wdammak Date: Thu, 12 Sep 2024 12:50:08 +0100 Subject: [PATCH 01/10] Fix: Invalid argument supplied for foreach AdminStatsController --- controllers/admin/AdminStatsController.php | 60 ++++++++++++---------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/controllers/admin/AdminStatsController.php b/controllers/admin/AdminStatsController.php index 325499f8a..b591ade62 100644 --- a/controllers/admin/AdminStatsController.php +++ b/controllers/admin/AdminStatsController.php @@ -225,7 +225,7 @@ class AdminStatsControllerCore extends AdminStatsTabController { if ($granularity == 'day') { $sales = array(); - $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS( + if ($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS( 'SELECT LEFT(`invoice_date`, 10) AS date, SUM(total_paid_tax_excl / o.conversion_rate) AS sales FROM `'._DB_PREFIX_.'orders` o LEFT JOIN `'._DB_PREFIX_.'order_state` os ON o.current_state = os.id_order_state @@ -236,14 +236,15 @@ class AdminStatsControllerCore extends AdminStatsTabController WHERE hbd.`id_order` = o.`id_order`' . HotelBranchInformation::addHotelRestriction($id_hotel).' ) GROUP BY LEFT(`invoice_date`, 10)' - ); - foreach ($result as $row) { - $sales[strtotime($row['date'])] = $row['sales']; - } + )) { + foreach ($result as $row) { + $sales[strtotime($row['date'])] = $row['sales']; + } + } return $sales; } elseif ($granularity == 'month') { $sales = array(); - $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS( + if ($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS( 'SELECT LEFT(`invoice_date`, 7) AS date, SUM(total_paid_tax_excl / o.conversion_rate) AS sales FROM `'._DB_PREFIX_.'orders` o LEFT JOIN `'._DB_PREFIX_.'order_state` os ON o.current_state = os.id_order_state @@ -254,11 +255,12 @@ class AdminStatsControllerCore extends AdminStatsTabController WHERE hbd.`id_order` = o.`id_order`' . HotelBranchInformation::addHotelRestriction($id_hotel).' ) GROUP BY LEFT(`invoice_date`, 7)' - ); + )) { - foreach ($result as $row) { - $sales[strtotime($row['date'].'-01')] = $row['sales']; - } + foreach ($result as $row) { + $sales[strtotime($row['date'].'-01')] = $row['sales']; + } + } return $sales; } else { @@ -296,7 +298,7 @@ class AdminStatsControllerCore extends AdminStatsTabController { if ($granularity == 'day') { $orders = array(); - $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + if ($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' SELECT LEFT(`invoice_date`, 10) as date, COUNT(DISTINCT o.`id_order`) as orders FROM `'._DB_PREFIX_.'orders` o LEFT JOIN `'._DB_PREFIX_.'order_state` os ON o.current_state = os.id_order_state @@ -304,14 +306,15 @@ class AdminStatsControllerCore extends AdminStatsTabController WHERE `invoice_date` BETWEEN "'.pSQL($date_from).' 00:00:00" AND "'.pSQL($date_to).' 23:59:59" AND os.logable = 1 '.Shop::addSqlRestriction(false, 'o') .HotelBranchInformation::addHotelRestriction($id_hotel, 'hbd').' - GROUP BY LEFT(`invoice_date`, 10)'); - foreach ($result as $row) { - $orders[strtotime($row['date'])] = $row['orders']; - } + GROUP BY LEFT(`invoice_date`, 10)')) { + foreach ($result as $row) { + $orders[strtotime($row['date'])] = $row['orders']; + } + } return $orders; } elseif ($granularity == 'month') { $orders = array(); - $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + if ($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' SELECT LEFT(`invoice_date`, 7) as date, COUNT(DISTINCT o.`id_order`) as orders FROM `'._DB_PREFIX_.'orders` o LEFT JOIN `'._DB_PREFIX_.'order_state` os ON o.current_state = os.id_order_state @@ -319,9 +322,10 @@ class AdminStatsControllerCore extends AdminStatsTabController WHERE `invoice_date` BETWEEN "'.pSQL($date_from).' 00:00:00" AND "'.pSQL($date_to).' 23:59:59" AND os.logable = 1 '.Shop::addSqlRestriction(false, 'o') .HotelBranchInformation::addHotelRestriction($id_hotel, 'hbd').' - GROUP BY LEFT(`invoice_date`, 7)'); - foreach ($result as $row) { - $orders[strtotime($row['date'].'-01')] = $row['orders']; + GROUP BY LEFT(`invoice_date`, 7)')) { + foreach ($result as $row) { + $orders[strtotime($row['date'].'-01')] = $row['orders']; + } } return $orders; } else { @@ -474,7 +478,7 @@ class AdminStatsControllerCore extends AdminStatsTabController { if ($granularity == 'day') { $purchases = array(); - $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' + if ($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT LEFT(`invoice_date`, 10) as date, SUM(od.`product_quantity` * IF( @@ -496,10 +500,11 @@ class AdminStatsControllerCore extends AdminStatsTabController FROM `qlo_htl_booking_detail` hbd WHERE hbd.`id_order` = o.`id_order`' . HotelBranchInformation::addHotelRestriction($id_hotel).' ) - GROUP BY LEFT(`invoice_date`, 10)'); + GROUP BY LEFT(`invoice_date`, 10)')) { - foreach ($result as $row) { - $purchases[strtotime($row['date'])] = $row['total_purchase_price']; + foreach ($result as $row) { + $purchases[strtotime($row['date'])] = $row['total_purchase_price']; + } } return $purchases; @@ -527,7 +532,7 @@ class AdminStatsControllerCore extends AdminStatsTabController { if ($granularity == 'day') { $refunds = array(); - $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' + if ($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT LEFT(`invoice_date`, 10) as date, SUM(orr.`refunded_amount`) as total_refund_amount @@ -540,10 +545,11 @@ class AdminStatsControllerCore extends AdminStatsTabController FROM `qlo_htl_booking_detail` hbd WHERE hbd.`id_order` = o.`id_order`' . HotelBranchInformation::addHotelRestriction($id_hotel).' ) - GROUP BY LEFT(`invoice_date`, 10)'); + GROUP BY LEFT(`invoice_date`, 10)')) { - foreach ($result as $row) { - $refunds[strtotime($row['date'])] = $row['total_refund_amount']; + foreach ($result as $row) { + $refunds[strtotime($row['date'])] = $row['total_refund_amount']; + } } return $refunds; From 5a60060f7abea25814065b5f80d8456ecb323c32 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 17 Sep 2024 18:24:56 +0530 Subject: [PATCH 02/10] Fixed: undefined variable issue while updating the order status from the back office --- classes/order/Order.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/order/Order.php b/classes/order/Order.php index 3b8565bc6..67e8e48c2 100644 --- a/classes/order/Order.php +++ b/classes/order/Order.php @@ -2536,7 +2536,7 @@ class OrderCore extends ObjectModel foreach ($tax_calculator->getTaxesAmount($discounted_price_tax_excl) as $id_tax => $unit_amount) { $total_tax_base = 0; $total_tax_base = Tools::processPriceRounding($discounted_price_tax_excl, $quantity); - $totalPrice = Tools::processPriceRounding($unit_amount, $quantity); + $total_amount = Tools::processPriceRounding($unit_amount, $quantity); if (!isset($breakdown[$id_tax])) { $breakdown[$id_tax] = array('tax_base' => 0, 'tax_amount' => 0); From d088111becfcba37da57d6c87b1dc751226ec68a Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 17 Sep 2024 18:42:18 +0530 Subject: [PATCH 03/10] Fixed: Wrong number of customers in the manage your customer list in the admin office --- controllers/admin/AdminCustomersController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index ae8553e62..c523ffd3c 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -82,7 +82,6 @@ class AdminCustomersControllerCore extends AdminController $this->_join .= ' LEFT JOIN '._DB_PREFIX_.'orders o ON (a.id_customer = o.id_customer)'; $this->_group = 'GROUP BY a.`id_customer`'; - $this->_use_found_rows = false; $this->fields_list = array( 'id_customer' => array( 'title' => $this->l('ID'), From ca0500dbd2c65dfd6fb4d6a4f64286d2db3856a2 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 17 Sep 2024 18:51:57 +0530 Subject: [PATCH 04/10] Fixed: wrong customers gender percentage in the admin customer KPI --- controllers/admin/AdminStatsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminStatsController.php b/controllers/admin/AdminStatsController.php index 325499f8a..800242953 100644 --- a/controllers/admin/AdminStatsController.php +++ b/controllers/admin/AdminStatsController.php @@ -362,7 +362,7 @@ class AdminStatsControllerCore extends AdminStatsTabController SELECT SUM(IF(c.id_gender IS NOT NULL, 1, 0)) as total, SUM(IF(type = 0, 1, 0)) as male, SUM(IF(type = 1, 1, 0)) as female, SUM(IF(type = 2, 1, 0)) as neutral FROM `'._DB_PREFIX_.'customer` c LEFT JOIN `'._DB_PREFIX_.'gender` g ON c.id_gender = g.id_gender - WHERE c.active = 1 AND c.deleted = 0 '.Shop::addSqlRestriction()); + WHERE 1 AND c.deleted = 0 '.Shop::addSqlRestriction()); if (!$row['total']) { return false; From 01ce3cb57c4ca537cdc0b6365e4060b7289241b8 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 17 Sep 2024 19:18:57 +0530 Subject: [PATCH 05/10] Fixed: Wrong count of the customer messages in the KPI on order detail page in the admin office --- classes/CustomerThread.php | 12 +++++++++++- controllers/admin/AdminOrdersController.php | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/classes/CustomerThread.php b/classes/CustomerThread.php index 70db8c507..cfc1772c0 100644 --- a/classes/CustomerThread.php +++ b/classes/CustomerThread.php @@ -38,6 +38,8 @@ class CustomerThreadCore extends ObjectModel public $token; public $date_add; public $date_upd; + const QLO_CUSTOMER_THREAD_TYPE_SENT = 1; + const QLO_CUSTOMER_THREAD_TYPE_RECEIVED = 2; /** * @see ObjectModel::$definition @@ -120,7 +122,7 @@ class CustomerThreadCore extends ObjectModel return $return; } - public static function getCustomerMessages($id_customer, $read = null, $id_order = null) + public static function getCustomerMessages($id_customer, $read = null, $id_order = null, $threadType = null) { $sql = 'SELECT * FROM '._DB_PREFIX_.'customer_thread ct @@ -135,6 +137,14 @@ class CustomerThreadCore extends ObjectModel $sql .= ' AND ct.`id_order` = '.(int)$id_order; } + if ($threadType != null) { + if (self::QLO_CUSTOMER_THREAD_TYPE_SENT == $threadType) { + $sql .= ' AND cm.`id_employee` != 0'; + } else if (self::QLO_CUSTOMER_THREAD_TYPE_RECEIVED == $threadType) { + $sql .= ' AND cm.`id_employee` = 0'; + } + } + $sql .= ' ORDER BY cm.date_add DESC'; return Db::getInstance()->executeS($sql); diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 30236549b..faa6183f3 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -2431,7 +2431,7 @@ class AdminOrdersControllerCore extends AdminController $helper->title = $this->l('Messages'); $helper->tooltip = $this->l('Messages is the number of customer messages for this order.'); $helper->href = $this->context->link->getAdminLink('AdminCustomerThreads').'&id_order='.$objOrder->id; - $helper->value = count(CustomerThread::getCustomerMessages($objOrder->id_customer, null, $objOrder->id)); + $helper->value = count(CustomerThread::getCustomerMessages($objOrder->id_customer, null, $objOrder->id, CustomerThread::QLO_CUSTOMER_THREAD_TYPE_RECEIVED)); $this->kpis[] = $helper; $objHotelBookingDetail = new HotelBookingDetail(); From b42e314d5b37440321619bea9ca496a82d8fe91f Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 17 Sep 2024 20:04:43 +0530 Subject: [PATCH 06/10] Optimized the code for the customer messages --- classes/CustomerMessage.php | 2 ++ classes/CustomerThread.php | 10 ++++------ controllers/admin/AdminOrdersController.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/classes/CustomerMessage.php b/classes/CustomerMessage.php index 99522fa0d..3406a60ef 100644 --- a/classes/CustomerMessage.php +++ b/classes/CustomerMessage.php @@ -37,6 +37,8 @@ class CustomerMessageCore extends ObjectModel public $date_add; public $date_upd; public $read; + const QLO_CUSTOMER_MESSAGE_BY_ADMIN = 1; + const QLO_CUSTOMER_MESSAGE_BY_ADMIN_CUSTOMER = 2; /** * @see ObjectModel::$definition diff --git a/classes/CustomerThread.php b/classes/CustomerThread.php index cfc1772c0..ef4d99c4a 100644 --- a/classes/CustomerThread.php +++ b/classes/CustomerThread.php @@ -38,8 +38,6 @@ class CustomerThreadCore extends ObjectModel public $token; public $date_add; public $date_upd; - const QLO_CUSTOMER_THREAD_TYPE_SENT = 1; - const QLO_CUSTOMER_THREAD_TYPE_RECEIVED = 2; /** * @see ObjectModel::$definition @@ -122,7 +120,7 @@ class CustomerThreadCore extends ObjectModel return $return; } - public static function getCustomerMessages($id_customer, $read = null, $id_order = null, $threadType = null) + public static function getCustomerMessages($id_customer, $read = null, $id_order = null, $messageBy = null) { $sql = 'SELECT * FROM '._DB_PREFIX_.'customer_thread ct @@ -137,10 +135,10 @@ class CustomerThreadCore extends ObjectModel $sql .= ' AND ct.`id_order` = '.(int)$id_order; } - if ($threadType != null) { - if (self::QLO_CUSTOMER_THREAD_TYPE_SENT == $threadType) { + if ($messageBy !== null) { + if (CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_ADMIN == $messageBy) { $sql .= ' AND cm.`id_employee` != 0'; - } else if (self::QLO_CUSTOMER_THREAD_TYPE_RECEIVED == $threadType) { + } else if (CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_ADMIN_CUSTOMER == $messageBy) { $sql .= ' AND cm.`id_employee` = 0'; } } diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index faa6183f3..d490e1b9b 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -2431,7 +2431,7 @@ class AdminOrdersControllerCore extends AdminController $helper->title = $this->l('Messages'); $helper->tooltip = $this->l('Messages is the number of customer messages for this order.'); $helper->href = $this->context->link->getAdminLink('AdminCustomerThreads').'&id_order='.$objOrder->id; - $helper->value = count(CustomerThread::getCustomerMessages($objOrder->id_customer, null, $objOrder->id, CustomerThread::QLO_CUSTOMER_THREAD_TYPE_RECEIVED)); + $helper->value = count(CustomerThread::getCustomerMessages($objOrder->id_customer, null, $objOrder->id, CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_ADMIN)); $this->kpis[] = $helper; $objHotelBookingDetail = new HotelBookingDetail(); From 6f3a8d30f6f29ee1b5ba4869e34cf2395c6ebb70 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 18 Sep 2024 12:04:46 +0530 Subject: [PATCH 07/10] Fixed: customer message constant name --- classes/CustomerThread.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/CustomerThread.php b/classes/CustomerThread.php index ef4d99c4a..f624d0e9c 100644 --- a/classes/CustomerThread.php +++ b/classes/CustomerThread.php @@ -138,7 +138,7 @@ class CustomerThreadCore extends ObjectModel if ($messageBy !== null) { if (CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_ADMIN == $messageBy) { $sql .= ' AND cm.`id_employee` != 0'; - } else if (CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_ADMIN_CUSTOMER == $messageBy) { + } else if (CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_CUSTOMER == $messageBy) { $sql .= ' AND cm.`id_employee` = 0'; } } From 0c06fc1e8ab585564cc18f06b8fcaf1e57c73eca Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 18 Sep 2024 12:05:21 +0530 Subject: [PATCH 08/10] Fixed: customer message constant name --- classes/CustomerMessage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/CustomerMessage.php b/classes/CustomerMessage.php index 3406a60ef..4f03df6a4 100644 --- a/classes/CustomerMessage.php +++ b/classes/CustomerMessage.php @@ -38,7 +38,7 @@ class CustomerMessageCore extends ObjectModel public $date_upd; public $read; const QLO_CUSTOMER_MESSAGE_BY_ADMIN = 1; - const QLO_CUSTOMER_MESSAGE_BY_ADMIN_CUSTOMER = 2; + const QLO_CUSTOMER_MESSAGE_BY_CUSTOMER = 2; /** * @see ObjectModel::$definition From 68443423614f93c3bf47b10e2854d018d76131e9 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 18 Sep 2024 12:36:06 +0530 Subject: [PATCH 09/10] Updated: renamed the customer message by admin const to customer message by employee --- classes/CustomerMessage.php | 2 +- classes/CustomerThread.php | 2 +- controllers/admin/AdminOrdersController.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/CustomerMessage.php b/classes/CustomerMessage.php index 4f03df6a4..b67433fc8 100644 --- a/classes/CustomerMessage.php +++ b/classes/CustomerMessage.php @@ -37,7 +37,7 @@ class CustomerMessageCore extends ObjectModel public $date_add; public $date_upd; public $read; - const QLO_CUSTOMER_MESSAGE_BY_ADMIN = 1; + const QLO_CUSTOMER_MESSAGE_BY_EMPLOYEE = 1; const QLO_CUSTOMER_MESSAGE_BY_CUSTOMER = 2; /** diff --git a/classes/CustomerThread.php b/classes/CustomerThread.php index f624d0e9c..7d5353934 100644 --- a/classes/CustomerThread.php +++ b/classes/CustomerThread.php @@ -136,7 +136,7 @@ class CustomerThreadCore extends ObjectModel } if ($messageBy !== null) { - if (CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_ADMIN == $messageBy) { + if (CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_EMPLOYEE == $messageBy) { $sql .= ' AND cm.`id_employee` != 0'; } else if (CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_CUSTOMER == $messageBy) { $sql .= ' AND cm.`id_employee` = 0'; diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index d490e1b9b..8edbaa814 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -2431,7 +2431,7 @@ class AdminOrdersControllerCore extends AdminController $helper->title = $this->l('Messages'); $helper->tooltip = $this->l('Messages is the number of customer messages for this order.'); $helper->href = $this->context->link->getAdminLink('AdminCustomerThreads').'&id_order='.$objOrder->id; - $helper->value = count(CustomerThread::getCustomerMessages($objOrder->id_customer, null, $objOrder->id, CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_ADMIN)); + $helper->value = count(CustomerThread::getCustomerMessages($objOrder->id_customer, null, $objOrder->id, CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_EMPLOYEE)); $this->kpis[] = $helper; $objHotelBookingDetail = new HotelBookingDetail(); From 3bfd26eb61fd935836a6a6a04df44ea7f41eaa39 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 18 Sep 2024 12:59:58 +0530 Subject: [PATCH 10/10] Fixed the wrong function call for the customer messages in AdminOrdersController, Added definition for the CustomerThread::getCustomerMessages() function --- classes/CustomerMessage.php | 1 + classes/CustomerThread.php | 10 ++++++++++ controllers/admin/AdminOrdersController.php | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/classes/CustomerMessage.php b/classes/CustomerMessage.php index b67433fc8..a4b6c920d 100644 --- a/classes/CustomerMessage.php +++ b/classes/CustomerMessage.php @@ -37,6 +37,7 @@ class CustomerMessageCore extends ObjectModel public $date_add; public $date_upd; public $read; + const QLO_CUSTOMER_MESSAGE_BY_EMPLOYEE = 1; const QLO_CUSTOMER_MESSAGE_BY_CUSTOMER = 2; diff --git a/classes/CustomerThread.php b/classes/CustomerThread.php index 7d5353934..7e1b721af 100644 --- a/classes/CustomerThread.php +++ b/classes/CustomerThread.php @@ -120,6 +120,16 @@ class CustomerThreadCore extends ObjectModel return $return; } + /** + * Retrieves customer messages based on specified conditions. + * + * @param int $id_customer Customer ID. + * @param bool|null $read Return read (true), unread (false), or all messages (null). + * @param int|null $id_order Filter messages by order ID. + * @param int|null $messageBy Filter messages by sender (employees, customer, or both). + * + * @return array List of messages matching the conditions. + */ public static function getCustomerMessages($id_customer, $read = null, $id_order = null, $messageBy = null) { $sql = 'SELECT * diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 8edbaa814..b3a65eac7 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -2431,7 +2431,7 @@ class AdminOrdersControllerCore extends AdminController $helper->title = $this->l('Messages'); $helper->tooltip = $this->l('Messages is the number of customer messages for this order.'); $helper->href = $this->context->link->getAdminLink('AdminCustomerThreads').'&id_order='.$objOrder->id; - $helper->value = count(CustomerThread::getCustomerMessages($objOrder->id_customer, null, $objOrder->id, CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_EMPLOYEE)); + $helper->value = count(CustomerThread::getCustomerMessages($objOrder->id_customer, null, $objOrder->id, CustomerMessage::QLO_CUSTOMER_MESSAGE_BY_CUSTOMER)); $this->kpis[] = $helper; $objHotelBookingDetail = new HotelBookingDetail();