From 596e8d64085f49c46dfa00bec24e4ce219e8586e Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 2 Jul 2025 13:48:29 +0530 Subject: [PATCH] Fixed: Discount is still showing on the invoice after all the rooms are deleted from the order --- controllers/admin/AdminOrdersController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index a97598697..7c9fd4aef 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -6521,6 +6521,14 @@ class AdminOrdersControllerCore extends AdminController } } + + // set the discounts in the invoices as 0 after all the cart rules are deleted. + if ($order_detail->id_order_invoice != 0) { + $order_invoice->total_discount_tax_incl = 0; + $order_invoice->total_discount_tax_excl = 0; + $res &= $order_invoice->update(); + } + // If no rooms left in the order, Update Order total and discounts to 0 $order->total_discounts = 0; $order->total_discounts_tax_incl = 0;