From c927a5db09123a19e896e3ca20abf9a66cc3d3d1 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Wed, 21 May 2025 16:51:00 +0530 Subject: [PATCH 1/4] Fixed: When booking is created from back-office with a partial amount, then full payment is displaye in the Payment type KPI --- controllers/admin/AdminOrdersController.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index b852574d7..c0f8eb149 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -2500,12 +2500,19 @@ class AdminOrdersControllerCore extends AdminController $this->kpis[] = $helper; $helper = new HelperKpi(); + if (isset($orderHistory[0]['id_order_state']) && ($orderHistory[0]['id_order_state'] == Configuration::get('PS_OS_PAYMENT_ACCEPTED'))) { + $initialPaymentType = $this->l('Full Payment'); + } elseif (isset($orderHistory[0]['id_order_state']) && ($orderHistory[0]['id_order_state'] == Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED'))) { + $initialPaymentType = $this->l('Partial Payment'); + } else { + $initialPaymentType = $this->l('No Payment'); + } $helper->id = 'box-payment-type'; $helper->icon = 'icon-home'; $helper->color = 'color3'; - $helper->title = $this->l('Payment Type'); - $helper->tooltip = $this->l('The payment type refers to the type of payment that customer selected while placing this order.'); - $helper->value = $objOrder->is_advance_payment ? $this->l('Partial Payment') : $this->l('Full Payment'); + $helper->title = $this->l('Initial Payment Type'); + $helper->tooltip = $this->l('Initial payment type refers to the portion of the total order amount that the customer paid at the time of placing the order.'); + $helper->value = $initialPaymentType; $this->kpis[] = $helper; if ($objOrder->is_advance_payment) { From 0844ac10c8453ec2ee5bfaadae0dcc8426ae03cc Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Thu, 22 May 2025 12:17:33 +0530 Subject: [PATCH 2/4] Text corections --- controllers/admin/AdminOrdersController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index c0f8eb149..12b606fe2 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -2505,13 +2505,13 @@ class AdminOrdersControllerCore extends AdminController } elseif (isset($orderHistory[0]['id_order_state']) && ($orderHistory[0]['id_order_state'] == Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED'))) { $initialPaymentType = $this->l('Partial Payment'); } else { - $initialPaymentType = $this->l('No Payment'); + $initialPaymentType = $this->l('No Payment Received '); } $helper->id = 'box-payment-type'; $helper->icon = 'icon-home'; $helper->color = 'color3'; - $helper->title = $this->l('Initial Payment Type'); - $helper->tooltip = $this->l('Initial payment type refers to the portion of the total order amount that the customer paid at the time of placing the order.'); + $helper->title = $this->l('Initial Payment Status'); + $helper->tooltip = $this->l('Initial Payment Status defines whether the order was fully paid, partially paid, or had no payment received at the time the order was placed.'); $helper->value = $initialPaymentType; $this->kpis[] = $helper; From 7c4b9cbe10cb54fcaf377a1fee9e4b327141d3af Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Thu, 22 May 2025 12:21:06 +0530 Subject: [PATCH 3/4] Text corections --- controllers/admin/AdminOrdersController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 12b606fe2..e50b01c08 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -2501,18 +2501,18 @@ class AdminOrdersControllerCore extends AdminController $helper = new HelperKpi(); if (isset($orderHistory[0]['id_order_state']) && ($orderHistory[0]['id_order_state'] == Configuration::get('PS_OS_PAYMENT_ACCEPTED'))) { - $initialPaymentType = $this->l('Full Payment'); + $initialPaymentStatus = $this->l('Full Payment'); } elseif (isset($orderHistory[0]['id_order_state']) && ($orderHistory[0]['id_order_state'] == Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED'))) { - $initialPaymentType = $this->l('Partial Payment'); + $initialPaymentStatus = $this->l('Partial Payment'); } else { - $initialPaymentType = $this->l('No Payment Received '); + $initialPaymentStatus = $this->l('No Payment Received '); } - $helper->id = 'box-payment-type'; + $helper->id = 'box-payment-status'; $helper->icon = 'icon-home'; $helper->color = 'color3'; $helper->title = $this->l('Initial Payment Status'); $helper->tooltip = $this->l('Initial Payment Status defines whether the order was fully paid, partially paid, or had no payment received at the time the order was placed.'); - $helper->value = $initialPaymentType; + $helper->value = $initialPaymentStatus; $this->kpis[] = $helper; if ($objOrder->is_advance_payment) { From 8179b4457a1f757c3cea70071682680be9687074 Mon Sep 17 00:00:00 2001 From: Rohit Jain Date: Thu, 22 May 2025 18:03:40 +0530 Subject: [PATCH 4/4] Update controllers/admin/AdminOrdersController.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- controllers/admin/AdminOrdersController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 6ebe8d3ac..4fb4b4347 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -2664,7 +2664,7 @@ class AdminOrdersControllerCore extends AdminController } elseif (isset($orderHistory[0]['id_order_state']) && ($orderHistory[0]['id_order_state'] == Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED'))) { $initialPaymentStatus = $this->l('Partial Payment'); } else { - $initialPaymentStatus = $this->l('No Payment Received '); + $initialPaymentStatus = $this->l('No Payment Received'); } $helper->id = 'box-payment-status'; $helper->icon = 'icon-home';