From 1a853640df47d6ae4e729606cf0837403e6f98e9 Mon Sep 17 00:00:00 2001 From: amandeep sharma qlo Date: Tue, 28 Oct 2025 11:32:27 +0530 Subject: [PATCH 01/15] Fixed: Improper Session Invalidation --- classes/Cookie.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/classes/Cookie.php b/classes/Cookie.php index de404e6ae..ef31241ee 100644 --- a/classes/Cookie.php +++ b/classes/Cookie.php @@ -332,6 +332,14 @@ class CookieCore $this->logout(); } + if (isset($this->_content['id_customer']) && isset($this->_content['passwd']) && (int)$this->_content['id_customer']) { + if (Validate::isLoadedObject($objCustomer = new Customer((int)$this->_content['id_customer']))) { + if ($objCustomer->passwd != $this->_content['passwd']) { + $this->logout(); + } + } + } + if (!isset($this->_content['date_add'])) { $this->_content['date_add'] = date('Y-m-d H:i:s'); } From ea5ae9c3aecb91709c15b193fe6fdc625caa6f55 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Mon, 24 Nov 2025 13:37:38 +0530 Subject: [PATCH 02/15] Fixed : Need to add id elem in the callback for the start Tree --- admin/themes/default/template/helpers/tree/tree.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/themes/default/template/helpers/tree/tree.tpl b/admin/themes/default/template/helpers/tree/tree.tpl index c81b96460..8942abe52 100644 --- a/admin/themes/default/template/helpers/tree/tree.tpl +++ b/admin/themes/default/template/helpers/tree/tree.tpl @@ -123,7 +123,7 @@ function startTree(idElem) { if (typeof $.fn.tree === 'undefined') { - setTimeout(startTree, 100); + setTimeout(function() { startTree(idElem); }, 100); return; } From 5b1bca050e97c249d168800d5083e9b337a24566 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Thu, 27 Nov 2025 16:40:03 +0530 Subject: [PATCH 03/15] Fixed: use is_object instead of isset --- classes/controller/AdminController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 67d88e69a..65442ce7d 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -2387,7 +2387,7 @@ class AdminControllerCore extends Controller $must_have_module_list = file_get_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST); if (!empty($must_have_module_list) && $must_have_module_list_xml = @simplexml_load_string($must_have_module_list)) { $must_have_module_list_array = array(); - if (is_object($country_module_list_xml->module)) { + if (is_object($must_have_module_list_xml->module)) { foreach ($must_have_module_list_xml->module as $l => $mo) { $all_module_list[] = (string)$mo->name; } From 7bb61dc0948aa548acc79dd2fa383cf025e7a75d Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Fri, 5 Dec 2025 15:12:47 +0530 Subject: [PATCH 04/15] Added: Refund remarks now visible in PayPay refund list --- .../admin/paypal_commerce_transaction/helpers/view/view.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/qlopaypalcommerce/views/templates/admin/paypal_commerce_transaction/helpers/view/view.tpl b/modules/qlopaypalcommerce/views/templates/admin/paypal_commerce_transaction/helpers/view/view.tpl index 67e31f9ff..4efc2cd82 100644 --- a/modules/qlopaypalcommerce/views/templates/admin/paypal_commerce_transaction/helpers/view/view.tpl +++ b/modules/qlopaypalcommerce/views/templates/admin/paypal_commerce_transaction/helpers/view/view.tpl @@ -176,6 +176,7 @@ {l s='Amount' mod='qlopaypalcommerce'} {l s='Type' mod='qlopaypalcommerce'} {l s='Status' mod='qlopaypalcommerce'} + {l s='Remark' mod='qlopaypalcommerce'} {l s='Date' mod='qlopaypalcommerce'} {if $refund_data} @@ -197,6 +198,7 @@ {/if} + {$refund.refund_reason|escape:'html':'UTF-8'} {$refund.date_add|escape:'html':'UTF-8'} {/foreach} From e8c59db55803db2fe64994dd7f02162877d825a0 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Tue, 9 Dec 2025 18:25:53 +0530 Subject: [PATCH 05/15] Fixed: Warning error when trying to set an invalid ID or modify the id_paypal_commerce_order parameter name. --- ...minPaypalCommerceTransactionController.php | 62 ++++++++++--------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/modules/qlopaypalcommerce/controllers/admin/AdminPaypalCommerceTransactionController.php b/modules/qlopaypalcommerce/controllers/admin/AdminPaypalCommerceTransactionController.php index 8de5e39e3..002edbe85 100644 --- a/modules/qlopaypalcommerce/controllers/admin/AdminPaypalCommerceTransactionController.php +++ b/modules/qlopaypalcommerce/controllers/admin/AdminPaypalCommerceTransactionController.php @@ -137,39 +137,45 @@ class AdminPaypalCommerceTransactionController extends ModuleAdminController $smartyVars = array(); $refundData = array(); $totalRefunded = 0; - $transactionData = WKPayPalCommerceOrder::getTransactionDetails((int)$idTrans); - $orderCurrency = new Currency((int)$transactionData['id_currency']); - $refundData = WkPaypalCommerceRefund::getRefundListByTransID((int)$idTrans); - $totalRefundedFormatted = WkPaypalCommerceRefund::getTotalRefundedAmount((int)$idTrans, true); + if ($transactionData = WKPayPalCommerceOrder::getTransactionDetails((int)$idTrans)) { + $orderCurrency = new Currency((int)$transactionData['id_currency']); + $refundData = WkPaypalCommerceRefund::getRefundListByTransID((int)$idTrans); + $totalRefundedFormatted = WkPaypalCommerceRefund::getTotalRefundedAmount((int)$idTrans, true); - $totalRefunded = WkPaypalCommerceRefund::getTotalRefundedAmount((int)$idTrans, false); - $remainingRefund = (float)($transactionData['pp_paid_total'] - $totalRefunded); - $response = Tools::jsonDecode($transactionData['response'], true); + $totalRefunded = WkPaypalCommerceRefund::getTotalRefundedAmount((int)$idTrans, false); + $remainingRefund = (float)($transactionData['pp_paid_total'] - $totalRefunded); + $response = Tools::jsonDecode($transactionData['response'], true); - // Buyer making a payment in a different currency (ex: EUR) which is different from the default currency of merchant (Ex: USD), In all those cross currency cases, After Capture, transaction will fall into Pending state and will require merchant to manually go to his PayPal account and accept the payment. - $objPPOrder = new WKPayPalCommerceOrder(); - if (isset($response['data']['purchase_units'][0]['payments']['captures'][0]['status_details']['reason']) - && ($transactionData['pp_payment_status'] == 'PENDING' || $transactionData['pp_payment_status'] == 'DENIED') - && isset($response['data']['purchase_units'][0]['payments']['captures'][0]['status_details']['reason']) - ) { - if (isset($objPPOrder->ppStatusDetail[$response['data']['purchase_units'][0]['payments']['captures'][0]['status_details']['reason']])) { - $smartyVars['ppstatusDetailMsg'] = $objPPOrder->ppStatusDetail[$response['data']['purchase_units'][0]['payments']['captures'][0]['status_details']['reason']]; + // Buyer making a payment in a different currency (ex: EUR) which is different from the default currency of merchant (Ex: USD), In all those cross currency cases, After Capture, transaction will fall into Pending state and will require merchant to manually go to his PayPal account and accept the payment. + $objPPOrder = new WKPayPalCommerceOrder(); + if ( + isset($response['data']['purchase_units'][0]['payments']['captures'][0]['status_details']['reason']) + && ($transactionData['pp_payment_status'] == 'PENDING' || $transactionData['pp_payment_status'] == 'DENIED') + && isset($response['data']['purchase_units'][0]['payments']['captures'][0]['status_details']['reason']) + ) { + if (isset($objPPOrder->ppStatusDetail[$response['data']['purchase_units'][0]['payments']['captures'][0]['status_details']['reason']])) { + $smartyVars['ppstatusDetailMsg'] = $objPPOrder->ppStatusDetail[$response['data']['purchase_units'][0]['payments']['captures'][0]['status_details']['reason']]; + } } + + $smartyVars['transaction_data'] = $transactionData; + $smartyVars['refund_data'] = $refundData; + $smartyVars['refunded_amount'] = $totalRefundedFormatted; + $smartyVars['remaining_refund'] = $remainingRefund; + $smartyVars['remaining_refund_format'] = Tools::displayPrice($remainingRefund, $orderCurrency); + $smartyVars['currency'] = $orderCurrency; + $smartyVars['WK_PAYPAL_COMMERCE_REFUND_TYPE_FULL'] = WkPaypalCommerceRefund::WK_PAYPAL_COMMERCE_REFUND_TYPE_FULL; + $smartyVars['WK_PAYPAL_COMMERCE_REFUND_TYPE_PARTIAL'] = WkPaypalCommerceRefund::WK_PAYPAL_COMMERCE_REFUND_TYPE_PARTIAL; + + $this->context->smarty->assign($smartyVars); + $this->base_tpl_view = 'view.tpl'; + return parent::renderView(); + } else { + Tools::redirectAdmin(self::$currentIndex . '&token=' . $this->token); } - - $smartyVars['transaction_data'] = $transactionData; - $smartyVars['refund_data'] = $refundData; - $smartyVars['refunded_amount'] = $totalRefundedFormatted; - $smartyVars['remaining_refund'] = $remainingRefund; - $smartyVars['remaining_refund_format'] = Tools::displayPrice($remainingRefund, $orderCurrency); - $smartyVars['currency'] = $orderCurrency; - $smartyVars['WK_PAYPAL_COMMERCE_REFUND_TYPE_FULL'] = WkPaypalCommerceRefund::WK_PAYPAL_COMMERCE_REFUND_TYPE_FULL; - $smartyVars['WK_PAYPAL_COMMERCE_REFUND_TYPE_PARTIAL'] = WkPaypalCommerceRefund::WK_PAYPAL_COMMERCE_REFUND_TYPE_PARTIAL; - - $this->context->smarty->assign($smartyVars); + } else { + Tools::redirectAdmin(self::$currentIndex . '&token=' . $this->token); } - $this->base_tpl_view = 'view.tpl'; - return parent::renderView(); } public function postProcess() From a13781d57d69e0e56218cf027f8e7695c5df1998 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Thu, 11 Dec 2025 12:30:36 +0530 Subject: [PATCH 06/15] Fixed: notices in the admin stats (Sales and orders tab ) while trying to export the data using the CSV export. --- modules/statssales/statssales.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/statssales/statssales.php b/modules/statssales/statssales.php index 0b89b0d0d..de828d507 100644 --- a/modules/statssales/statssales.php +++ b/modules/statssales/statssales.php @@ -310,10 +310,14 @@ class StatsSales extends ModuleGraph { $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate().$this->query_group_by.$this->query_having_filter); foreach ($result as $row) { + $days = (int)substr($row['invoice_date'], 8, 2); + if (!isset($this->_values[$days])) { + $this->_values[$days] = 0; + } if ($this->option == 1) { - $this->_values[(int)substr($row['invoice_date'], 8, 2)] += 1; + $this->_values[$days] += 1; } else { - $this->_values[(int)substr($row['invoice_date'], 8, 2)] += $row['total_revenue']; + $this->_values[$days] += $row['total_revenue']; } } } From a11eae75925721c3eb335fbd0501d0f8d39e9133 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Wed, 17 Dec 2025 16:59:20 +0530 Subject: [PATCH 07/15] Fixed: getting fatal error when , try to delete the installed theme. --- controllers/admin/AdminThemesController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php index 9781d25ef..abab7d6fd 100644 --- a/controllers/admin/AdminThemesController.php +++ b/controllers/admin/AdminThemesController.php @@ -714,8 +714,11 @@ class AdminThemesControllerCore extends AdminController } $ids_themes = Tools::unSerialize(Configuration::get('PS_ADDONS_THEMES_IDS')); - if (array_key_exists($obj->directory, $ids_themes)) { - unset($ids_themes[$obj->directory]); + + if(is_array($ids_themes)) { + if (array_key_exists($obj->directory, $ids_themes)) { + unset($ids_themes[$obj->directory]); + } } $obj->removeMetas(); From 05809592fc975eb6440bdcd83fbb4fcce4069580 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Mon, 29 Dec 2025 16:59:45 +0530 Subject: [PATCH 08/15] Padding will be only added where there are child elements of #center_column --- themes/hotel-reservation-theme/css/global.css | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/themes/hotel-reservation-theme/css/global.css b/themes/hotel-reservation-theme/css/global.css index 1c8ecf2e3..7fb667b55 100644 --- a/themes/hotel-reservation-theme/css/global.css +++ b/themes/hotel-reservation-theme/css/global.css @@ -5776,10 +5776,13 @@ textarea { background: #fff; } #columns { + padding: 0; +} +#columns:has(#center_column > *) { position: relative; padding-bottom: 50px; - padding-top: 15px; } - + padding-top: 15px; +} #index .tab-content { margin-top: 35px; margin-bottom: 34px; } From cec5fb73900cf6f0a763cdf9a23b4a136170cf94 Mon Sep 17 00:00:00 2001 From: aradhana kumari Date: Mon, 5 Jan 2026 19:06:51 +0530 Subject: [PATCH 09/15] Update the text of the 'view room' to the 'View property' at our properties page in the front-office --- themes/hotel-reservation-theme/our-properties.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/hotel-reservation-theme/our-properties.tpl b/themes/hotel-reservation-theme/our-properties.tpl index 094f83dff..88f46e6ac 100644 --- a/themes/hotel-reservation-theme/our-properties.tpl +++ b/themes/hotel-reservation-theme/our-properties.tpl @@ -74,7 +74,7 @@ {$hotel['email']}

- {l s='View Rooms'} + {l s='View Property'} {if ($hotel['latitude'] != 0 || $hotel['longitude'] != 0) && $viewOnMap} {l s='View on map'} {/if} From 21d8abb68c5ef57f3c37877f023bbd7cbbc6d425 Mon Sep 17 00:00:00 2001 From: aradhana kumari Date: Thu, 15 Jan 2026 15:11:25 +0530 Subject: [PATCH 10/15] Update Name field in Manager Room Type form --- .../default/template/controllers/products/informations.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/themes/default/template/controllers/products/informations.tpl b/admin/themes/default/template/controllers/products/informations.tpl index fdfa02ee0..0e9c5c676 100644 --- a/admin/themes/default/template/controllers/products/informations.tpl +++ b/admin/themes/default/template/controllers/products/informations.tpl @@ -104,7 +104,7 @@
{include file="controllers/products/multishop/checkbox.tpl" field="name" type="default" multilang="true"}
From bd80ce244937839e100a67b3cd2deeec23936cc6 Mon Sep 17 00:00:00 2001 From: aradhana kumari Date: Thu, 15 Jan 2026 17:25:31 +0530 Subject: [PATCH 11/15] Option to add VAT number in invoice --- pdf/invoice.summary-tab.tpl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pdf/invoice.summary-tab.tpl b/pdf/invoice.summary-tab.tpl index 8f3fdae04..064af953a 100644 --- a/pdf/invoice.summary-tab.tpl +++ b/pdf/invoice.summary-tab.tpl @@ -28,11 +28,19 @@ {l s='Invoice Date' pdf='true'} {l s='Order Reference' pdf='true'} {l s='Order date' pdf='true'} + {if $addresses.invoice->vat_number} + {l s='VAT Number' pdf='true'} + {/if} {$title|escape:'html':'UTF-8'} {dateFormat date=$order->invoice_date full=0} {$order->getUniqReference()} {dateFormat date=$order->date_add full=0} + {if $addresses.invoice->vat_number} + + {$addresses.invoice->vat_number} + + {/if} From 1d046d881128f608f3acde4288fccf7e56110178 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Fri, 6 Feb 2026 12:12:18 +0530 Subject: [PATCH 12/15] fixed: unable to add more links from modules --- controllers/admin/AdminOrdersController.php | 98 ++++++++++----------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 30026bcca..ded8240de 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -368,6 +368,54 @@ class AdminOrdersControllerCore extends AdminController 'icon' => 'process-icon-new' ); } + if ($this->display == 'view') { + /** @var Order $order */ + if (Validate::isLoadedObject($order = $this->loadObject())) { + // hotel link in header + if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) { + $this->page_header_toolbar_btn['hotel'] = array( + 'href' => $this->context->link->getAdminLink('AdminAddHotel').'&id='.$idHotel.'&updatehtl_branch_info', + 'desc' => $this->l('View Hotel'), + 'class' => 'icon-building', + 'target' => true, + ); + } + + if (Configuration::get('PS_INVOICE') && $order->hasInvoice() && !$this->lite_display) { + $this->page_header_toolbar_btn['file'] = array( + 'short' => $this->l('Invoice'), + 'href' => $this->context->link->getAdminLink('AdminPdf').'&submitAction=generateInvoicePDF&id_order='.$order->id, + 'desc' => $this->l('View invoice'), + 'class' => 'icon-file-text', + 'target' => true, + ); + } + + $this->page_header_toolbar_btn['print'] = array( + 'short' => $this->l('Print'), + 'href' => 'javascript:window.print()', + 'desc' => $this->l('Print order'), + 'class' => 'icon-print', + ); + + if ($this->tabAccess['edit'] === 1) { + if (((int) $order->isReturnable()) + && !$order->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG, 0, 0) + ) { + $orderTotalPaid = $order->getTotalPaid(); + $orderDiscounts = $order->getCartRules(); + $hasOrderDiscountOrPayment = ((float)$orderTotalPaid > 0 || $orderDiscounts) ? true : false; + $this->page_header_toolbar_btn['cancel'] = array( + 'short' => ($hasOrderDiscountOrPayment) ? $this->l('Refund') : $this->l('Cancel'), + 'id' => 'desc-order-standard_refund', + 'desc' => ($hasOrderDiscountOrPayment) ? $this->l('Initiate refund') : $this->l('Cancel bookings'), + 'class' => 'icon-exchange', + 'target' => true, + ); + } + } + } + } parent::initPageHeaderToolbar(); } @@ -476,55 +524,6 @@ class AdminOrdersControllerCore extends AdminController public function initToolbar() { - if ($this->display == 'view') { - /** @var Order $order */ - if (Validate::isLoadedObject($order = $this->loadObject())) { - // hotel link in header - if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) { - $this->toolbar_btn['hotel'] = array( - 'href' => $this->context->link->getAdminLink('AdminAddHotel').'&id='.$idHotel.'&updatehtl_branch_info', - 'desc' => $this->l('View Hotel'), - 'class' => 'icon-building', - 'target' => true, - ); - } - - if (Configuration::get('PS_INVOICE') && $order->hasInvoice() && !$this->lite_display) { - $this->toolbar_btn['file'] = array( - 'short' => $this->l('Invoice'), - 'href' => $this->context->link->getAdminLink('AdminPdf').'&submitAction=generateInvoicePDF&id_order='.$order->id, - 'desc' => $this->l('View invoice'), - 'class' => 'icon-file-text', - 'target' => true, - ); - } - - $this->toolbar_btn['print'] = array( - 'short' => $this->l('Print'), - 'href' => 'javascript:window.print()', - 'desc' => $this->l('Print order'), - 'class' => 'icon-print', - ); - - if ($this->tabAccess['edit'] === 1) { - if (((int) $order->isReturnable()) - && !$order->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG, 0, 0) - ) { - $orderTotalPaid = $order->getTotalPaid(); - $orderDiscounts = $order->getCartRules(); - $hasOrderDiscountOrPayment = ((float)$orderTotalPaid > 0 || $orderDiscounts) ? true : false; - $this->toolbar_btn['cancel'] = array( - 'short' => ($hasOrderDiscountOrPayment) ? $this->l('Refund') : $this->l('Cancel'), - 'id' => 'desc-order-standard_refund', - 'desc' => ($hasOrderDiscountOrPayment) ? $this->l('Initiate refund') : $this->l('Cancel bookings'), - 'class' => 'icon-exchange', - 'target' => true, - ); - } - } - } - } - $res = parent::initToolbar(); if (Context::getContext()->shop->getContext() != Shop::CONTEXT_SHOP && isset($this->toolbar_btn['new']) && Shop::isFeatureActive()) { unset($this->toolbar_btn['new']); @@ -3710,6 +3709,7 @@ class AdminOrdersControllerCore extends AdminController 'ROOM_STATUS_CHECKED_OUT' => HotelBookingDetail::STATUS_CHECKED_OUT, 'ALLOTMENT_MANUAL' => HotelBookingDetail::ALLOTMENT_MANUAL, 'order_convenience_fee_services' => $orderConvenienceFeeServices, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn, ); return parent::renderView(); From 38514f37a23e24a7378c59c004fab054104003ef Mon Sep 17 00:00:00 2001 From: aradhana kumari Date: Tue, 17 Feb 2026 17:16:53 +0530 Subject: [PATCH 13/15] Fixed occupancy issue in the Book now page back-office --- .../helpers/view/_partials/booking-rooms.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl index 7c68db350..710d60348 100644 --- a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl @@ -261,7 +261,7 @@ {/if} {HotelRoomInformation::getRoomStatusTitle($unavail_dtl_v['id_status'])|escape:'htmlall':'UTF-8'} - {if $unavail_dtl_v['date_from'] && $unavail_dtl_v['date_to']} + {if isset($unavail_dtl_v['date_from']) && isset($unavail_dtl_v['date_to'])} {dateFormat date=$unavail_dtl_v['date_from']} - {dateFormat date=$unavail_dtl_v['date_to']} {else} -- From 77fb10f4a2600978eca24c9642066655ea087896 Mon Sep 17 00:00:00 2001 From: Rohit Jain Date: Fri, 27 Feb 2026 21:03:50 +0530 Subject: [PATCH 14/15] feat(ai): add agent.md (AI guidelines) for QloApps --- AGENTS.md | 225 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..87643113d --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,225 @@ +# AGENTS.md + +## Project Overview + +QloApps is an open-source hotel reservation and property management platform. It enables hotels to manage rooms, bookings, guests, and payments through a web-based system. + +## Purpose of this File + +This document provides guidance for AI coding agents contributing to the QloApps project. It defines conventions, safety rules, and workflows to ensure consistent and secure code generation. + +## Technology Stack + +- **Language:** PHP 8.1–8.4 (backend), Smarty 3.x (templates), JavaScript/jQuery (frontend) +- **Database:** MySQL 5.7, 8.0+; MariaDB 10.5, 10.6, 10.11, 11.0, 11.2, 11.4 +- **Architecture:** MVC with hook-based module system +- **License:** OSL-3.0 (core), AFL-3.0 (modules) +- **Required PHP Extensions:** PDO_MySQL, cURL, OpenSSL, SOAP, GD, SimpleXML, DOM, Zip, Phar + +## Environment Setup + +Install dependencies: +```bash +composer install +``` + +Clear caches: +```bash +rm -rf cache/smarty/compile/* cache/smarty/cache/* +rm -f cache/class_index.php +``` + +Clear class cache after adding or modifying overrides. + +## Project Structure + +``` +. +├── classes/ # Core models extending ObjectModel +├── controllers/ # Front and admin controllers +│ ├── admin/ +│ └── front/ +├── modules/ # Feature modules with isolated functionality +├── override/ # Core class and controller overrides +├── themes/ # Smarty templates (.tpl files) +├── config/ # Configuration files (settings.inc.php contains secrets) +├── cache/ # Generated cache files +├── tests/ # PHPUnit test suite +``` + +**QloApps Agent Skills:** Install reusable development skills using: +```bash +npx skills add Qloapps/agent-skills +``` +Available skills: module-development, payment-module-development, stats-module-development. Check installed skills before implementing new functionality. + +## Architecture Overview + +**MVC Pattern** +- Models: classes/ extending ObjectModel +- Controllers: FrontController or AdminController +- Views: Smarty templates (.tpl) + +**Modules** +- Located in modules// +- Provide isolated functionality +- Integrate using hooks + +**Overrides** +- Located in override/ +- Extend core classes using the Core suffix +- Clear class cache after creating overrides + +**Context** +- Access runtime objects using Context::getContext() + +## Core vs Module Development Rules + +**When working on a module:** +1. Never modify core files directly +2. Use **hooks** to integrate module functionality into core features +3. If no suitable hook exists, create a **custom hook** — but only if the hook placement is generic and useful for other modules too +4. Use **overrides** only as a last resort — overrides can conflict with other module override files and require manual resolution + +**When working on a core feature:** +- Make changes directly in core files +- Do not use hooks or overrides for core-to-core changes + +## Coding Conventions + +**Classes:** PascalCase — `HotelBookingData` +**Methods:** camelCase — `getBookingDetails()` +**Variables:** camelCase — `$hotelId` +**Constants:** UPPER_SNAKE_CASE — `BOOKING_STATUS_CONFIRMED` +**Database Tables:** _DB_PREFIX_ + lowercase_snake — `qlo_hotel_booking` +**Config Keys:** MODULENAME_SETTING — `HOTELRESERVATION_ENABLED` +**Files:** One class per file, filename matches class name +**Templates:** lowercase-hyphens.tpl — `booking-form.tpl` + +Add PHPDoc blocks to all classes and methods. + +## Translation + +Never hardcode user-facing English strings — always wrap them in the appropriate translation method. + +| Context | Method | +|---------|--------| +| Module main file | `$this->l('string')` | +| Module admin controller | `$this->l('string')` | +| Module front controller | `$this->module->l('string', 'controllerName')` | +| Module classes | `$objModule->l('string', 'ClassName')` | +| Core admin controller | `$this->l('string')` | +| Core front controller | `Tools::displayError('string')` | +| Smarty template (core) | `{l s='string'}` | +| Smarty template (module) | `{l s='string' mod='modulename'}` | + +## Multi-language + +- Always include `id_lang` in queries that return translatable content +- Use `Context::getContext()->language->id` for the current language + +## Module Development Guidelines + +**Module Location:** modules// + +**Required Files:** +- .php — Main class extending Module +- config.xml — Module metadata + +**Optional Directories:** +- classes/ — Module-specific models +- controllers/ — Module controllers +- views/templates/ — Smarty templates +- upgrade/ — Version migration scripts + +**Hook Integration:** +- Register hooks in install() method +- Unregister hooks in uninstall() method +- Keep hook handlers lightweight + +**Configuration:** +- Store settings using Configuration::updateValue() +- Retrieve settings using Configuration::get() +- Prefix config keys with module name + +## Database Rules + +**Table Prefix:** Always use _DB_PREFIX_ constant instead of hardcoding the table prefix + +**Escaping:** +- Strings: pSQL($value) +- Integers: (int)$value +- Table/column names: bqSQL($name) + +**Preferred Access:** Use ObjectModel for CRUD operations instead of raw SQL queries + +**Prohibited:** Never concatenate raw user input into SQL queries. + +## Security Guidelines + +**Input Handling** +- Use Tools::getValue() for request parameters +- Cast numeric values to (int) +- Escape strings using pSQL() +- Validate input using Validate class methods + +**Output Escaping** +- Use Tools::safeOutput() in PHP +- Use Smarty escape modifiers in templates + +**Sensitive Data** +- Never expose config/settings.inc.php +- Never commit API keys, passwords, or tokens + +**Authorization** +- Verify permissions before performing admin operations + +## Testing + +Testing infrastructure is being configured. Check tests/ directory for available tests before running. + +## AI Agent Workflow + +1. Check installed agent skills before implementing new functionality +2. Search codebase for similar implementations before creating new code +3. Extend existing classes rather than duplicating functionality +4. Follow patterns established in surrounding code +5. Reuse existing utilities: Tools, Validate, Db, Configuration classes +6. Prioritize consistency with existing codebase over new approaches + +After making changes: +- Clear caches if modifying templates or overrides +- Add PHPDoc to new methods + +## Safety Rules + +**Agents must not:** +- Delete files unless explicitly instructed +- Run git commands automatically +- Modify composer.json without approval +- Modify config/settings.inc.php +- Execute DROP, TRUNCATE, or destructive SQL +- Modify core files directly when working on a module (use hooks or override system) + +**Agents must:** +- Use pSQL() for strings and (int) for IDs in SQL +- Use Tools::getValue() for request parameters +- Escape all output +- Check installed agent skills before implementing new functionality +- Follow project naming conventions +- Validate inputs before processing + +**Agents should ask before:** +- Deleting any files +- Running git commands +- Changing dependencies +- Modifying database schema +- Altering payment or booking logic + +--- + +**Resources:** +- Documentation: https://docs.qloapps.com +- Forum: https://forums.qloapps.com +- GitHub: https://github.com/Qloapps/QloApps +- Security Issues: support@qloapps.com From 99df3599755eafbcaf9ee5993b48b0d3fc5f6dcc Mon Sep 17 00:00:00 2001 From: aradhana kumari Date: Wed, 25 Mar 2026 16:26:37 +0530 Subject: [PATCH 15/15] Add VAT Number to invoice summary PDF when available --- pdf/invoice.summary-tab.tpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pdf/invoice.summary-tab.tpl b/pdf/invoice.summary-tab.tpl index 064af953a..74491ba40 100644 --- a/pdf/invoice.summary-tab.tpl +++ b/pdf/invoice.summary-tab.tpl @@ -29,8 +29,8 @@ {l s='Order Reference' pdf='true'} {l s='Order date' pdf='true'} {if $addresses.invoice->vat_number} - {l s='VAT Number' pdf='true'} - {/if} + {l s='VAT Number' pdf='true'} + {/if} {$title|escape:'html':'UTF-8'} @@ -38,9 +38,9 @@ {$order->getUniqReference()} {dateFormat date=$order->date_add full=0} {if $addresses.invoice->vat_number} - - {$addresses.invoice->vat_number} - - {/if} + + {$addresses.invoice->vat_number|escape:'html':'UTF-8'} + + {/if}