From 87e40420052be92ad1235b0d1adc7088887b5ff3 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 29 May 2024 10:18:58 +0530 Subject: [PATCH] Revert changes on the valid and invalid orders count and amount --- controllers/admin/AdminCustomerThreadsController.php | 7 +------ controllers/admin/AdminCustomersController.php | 10 ++-------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/controllers/admin/AdminCustomerThreadsController.php b/controllers/admin/AdminCustomerThreadsController.php index 13a69f79c..f485cf4f4 100644 --- a/controllers/admin/AdminCustomerThreadsController.php +++ b/controllers/admin/AdminCustomerThreadsController.php @@ -656,13 +656,8 @@ class AdminCustomerThreadsControllerCore extends AdminController $total_ok = 0; $orders_ok = array(); foreach ($orders as $key => $order) { - if ($order['valid'] - || strtotime($order['order_last_date']) >= strtotime(date('Y-m-d')) - ) { + if ($order['valid']) { $orders_ok[] = $order; - } - - if ($order['total_paid_real']) { $total_ok += $order['total_paid_real']/$order['conversion_rate']; } diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index 587a915a7..d88bbd8a6 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -829,14 +829,9 @@ class AdminCustomersControllerCore extends AdminController $order['order_state'] = $this->l('There is no status defined for this order.'); } - if ($order['total_paid_real_not_formated']) { - $total_ok += $order['total_paid_real_not_formated']/$order['conversion_rate']; - } - - if ($order['valid'] - || strtotime($order['order_last_date']) >= strtotime(date('Y-m-d')) - ) { + if ($order['valid']) { $orders_ok[] = $order; + $total_ok += $order['total_paid_real_not_formated']/$order['conversion_rate']; } else { $orders_ko[] = $order; } @@ -867,7 +862,6 @@ class AdminCustomersControllerCore extends AdminController JOIN '._DB_PREFIX_.'product p ON (cp.id_product = p.id_product) AND p.booking_product=1 WHERE c.id_customer = '.(int)$customer->id.' - AND p.booking_product = 1 AND NOT EXISTS ( SELECT 1 FROM '._DB_PREFIX_.'orders o