From 61c5f59eb5fffdf995ae8b341c0ca35c42adda7f Mon Sep 17 00:00:00 2001 From: amit sharma Date: Thu, 24 Sep 2026 20:02:55 +0530 Subject: [PATCH] Fixed: Resolve fatal error on Stats page after Hotel Reports module installation --- classes/order/Order.php | 2 +- classes/order/OrderPayment.php | 4 +- .../classes/HotelBookingDetail.php | 52 ++++++------------- .../classes/HotelRoomInformation.php | 6 +-- .../classes/HotelRoomType.php | 10 ++-- .../classes/ServiceProductOrderDetail.php | 3 -- modules/qlohotelreports/qlohotelreports.php | 10 ++-- 7 files changed, 32 insertions(+), 55 deletions(-) diff --git a/classes/order/Order.php b/classes/order/Order.php index c59836651..0d9260f76 100644 --- a/classes/order/Order.php +++ b/classes/order/Order.php @@ -3377,7 +3377,7 @@ class OrderCore extends ObjectModel FROM `'._DB_PREFIX_.'orders` o INNER JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = o.`id_customer`) INNER JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd - ON (hbd.`id_order` = o.`id_order` AND hbd.`is_cancelled` = 0 AND hbd.`is_refunded` = 0) + ON (hbd.`id_order` = o.`id_order`) LEFT JOIN `'._DB_PREFIX_.'address` a ON (a.`id_customer` = c.`id_customer` AND a.`deleted` = 0 AND a.`id_address` = (SELECT MAX(`id_address`) FROM `'._DB_PREFIX_.'address` diff --git a/classes/order/OrderPayment.php b/classes/order/OrderPayment.php index 8310ad68e..834d7e282 100644 --- a/classes/order/OrderPayment.php +++ b/classes/order/OrderPayment.php @@ -188,7 +188,7 @@ class OrderPaymentCore extends ObjectModel INNER JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = o.`id_customer`) LEFT JOIN `'._DB_PREFIX_.'currency` cur ON (cur.`id_currency` = op.`id_currency`) INNER JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd - ON (hbd.`id_order` = o.`id_order` AND hbd.`is_cancelled` = 0) + ON (hbd.`id_order` = o.`id_order`) WHERE op.`date_add` BETWEEN "'.$dateFrom.' 00:00:00" AND "'.$dateTo.' 23:59:59"' .($idOrder ? ' AND o.`id_order` = '.$idOrder : '') .($idCustomer ? ' AND o.`id_customer` = '.$idCustomer : '') @@ -213,7 +213,7 @@ class OrderPaymentCore extends ObjectModel INNER JOIN `'._DB_PREFIX_.'orders` o ON (o.`reference` = op.`order_reference` AND o.`valid` = 1) INNER JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd - ON (hbd.`id_order` = o.`id_order` AND hbd.`is_cancelled` = 0) + ON (hbd.`id_order` = o.`id_order`) WHERE op.`payment_method` IS NOT NULL AND op.`payment_method` != ""' .HotelBranchInformation::addHotelRestriction($idHotel, 'hbd').' ORDER BY op.`payment_method`' diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index 36996e18a..c32a8b797 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -3947,9 +3947,8 @@ class HotelBookingDetail extends ObjectModel 'SELECT DATE(o.`date_add`) AS grp_date, IFNULL(SUM(hbd.`total_price_tax_excl` / o.`conversion_rate`), 0) AS total_price_tax_excl, IFNULL(SUM((hbd.`total_price_tax_incl` - hbd.`total_price_tax_excl`) / o.`conversion_rate`), 0) AS total_tax, - SUM(CASE WHEN hbd.`is_refunded` = 0 AND hbd.`is_cancelled` = 0 THEN 1 ELSE 0 END) AS rooms_booked, - SUM(CASE WHEN hbd.`is_refunded` = 0 AND hbd.`is_cancelled` = 0 - THEN DATEDIFF(hbd.`date_to`, hbd.`date_from`) ELSE 0 END) AS room_nights + COUNT(*) AS rooms_booked, + SUM(DATEDIFF(hbd.`date_to`, hbd.`date_from`)) AS room_nights FROM `'._DB_PREFIX_.'htl_booking_detail` hbd LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hbd.`id_product`) LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`) @@ -4011,8 +4010,7 @@ class HotelBookingDetail extends ObjectModel FROM `'._DB_PREFIX_.'htl_booking_detail` hbd LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hbd.`id_product`) LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`) - WHERE p.`active` = 1 AND o.`valid` = 1 AND hbd.`is_refunded` = 0 - AND hbd.`is_cancelled` = 0 + WHERE p.`active` = 1 AND o.`valid` = 1 AND hbd.`date_from` < "'.pSQL($nextDay).' 00:00:00" AND hbd.`date_to` > "'.pSQL($current).' 00:00:00"' .$whereFilters @@ -4049,9 +4047,7 @@ class HotelBookingDetail extends ObjectModel $result[strtotime($current)] = (int) Db::getInstance()->getValue( 'SELECT COUNT(hbd.`id_room`) FROM `'._DB_PREFIX_.'htl_booking_detail` hbd - WHERE hbd.`is_refunded` = 0 - AND hbd.`is_cancelled` = 0 - AND hbd.`is_back_order` = 0 + WHERE hbd.`is_back_order` = 0 AND hbd.`date_from` BETWEEN "'.pSQL($current).' 00:00:00" AND "'.pSQL($current).' 23:59:59"' .($idProduct ? ' AND hbd.`id_product` = '.$idProduct : '') .($idRoom ? ' AND hbd.`id_room` = '.$idRoom : '') @@ -4086,9 +4082,7 @@ class HotelBookingDetail extends ObjectModel $result[strtotime($current)] = (int) Db::getInstance()->getValue( 'SELECT COUNT(hbd.`id_room`) FROM `'._DB_PREFIX_.'htl_booking_detail` hbd - WHERE hbd.`is_refunded` = 0 - AND hbd.`is_cancelled` = 0 - AND hbd.`date_to` BETWEEN "'.pSQL($current).' 00:00:00" AND "'.pSQL($current).' 23:59:59" + WHERE hbd.`date_to` BETWEEN "'.pSQL($current).' 00:00:00" AND "'.pSQL($current).' 23:59:59" AND (hbd.`id_status` = '.(int) self::STATUS_CHECKED_IN .' OR (hbd.`check_in` != "0000-00-00 00:00:00" AND hbd.`check_out` != "0000-00-00 00:00:00"))' .($idProduct ? ' AND hbd.`id_product` = '.$idProduct : '') @@ -4136,8 +4130,7 @@ class HotelBookingDetail extends ObjectModel FROM `'._DB_PREFIX_.'htl_booking_detail` hbd LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`) LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = hbd.`id_customer`) - WHERE hbd.`is_refunded` = 0 - AND hbd.`is_back_order` = 0 + WHERE hbd.`is_back_order` = 0 AND hbd.`date_from` BETWEEN "'.$dateFrom.' 00:00:00" AND "'.$dateTo.' 23:59:59"' .$statusFilter .($idProduct ? ' AND hbd.`id_product` = '.$idProduct : '') @@ -4174,8 +4167,7 @@ class HotelBookingDetail extends ObjectModel FROM `'._DB_PREFIX_.'htl_booking_detail` hbd LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`) LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = hbd.`id_customer`) - WHERE hbd.`is_refunded` = 0 - AND hbd.`date_to` BETWEEN "'.$dateFrom.' 00:00:00" AND "'.$dateTo.' 23:59:59"' + WHERE hbd.`date_to` BETWEEN "'.$dateFrom.' 00:00:00" AND "'.$dateTo.' 23:59:59"' .($allStatuses ? '' : ' AND hbd.`id_status` = '.$idStatus) .($idProduct ? ' AND hbd.`id_product` = '.$idProduct : '') .($idRoom ? ' AND hbd.`id_room` = '.$idRoom : '') @@ -4210,8 +4202,7 @@ class HotelBookingDetail extends ObjectModel FROM `'._DB_PREFIX_.'htl_booking_detail` hbd LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`) LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = hbd.`id_customer`) - WHERE hbd.`is_refunded` = 0 - AND hbd.`id_status` IN ('.(int) self::STATUS_CHECKED_IN.', '.(int) self::STATUS_CHECKED_OUT.') + WHERE hbd.`id_status` IN ('.(int) self::STATUS_CHECKED_IN.', '.(int) self::STATUS_CHECKED_OUT.') AND hbd.`date_from` < "'.$dateTo.' 23:59:59" AND hbd.`date_to` > "'.$dateFrom.' 00:00:00"' .($idProduct ? ' AND hbd.`id_product` = '.$idProduct : '') @@ -4324,17 +4315,14 @@ class HotelBookingDetail extends ObjectModel SELECT hbd.`id_order`, IFNULL(NULLIF(o.`source`, \'\'), \'(direct)\') AS order_source, - SUM(CASE WHEN hbd.`is_cancelled` = 0 AND hbd.`is_refunded` = 0 THEN 1 ELSE 0 END) AS rooms_booked, - SUM(CASE WHEN hbd.`is_cancelled` = 0 AND hbd.`is_refunded` = 0 - THEN DATEDIFF(hbd.`date_to`, hbd.`date_from`) ELSE 0 END) AS room_nights, - SUM(CASE WHEN hbd.`is_cancelled` = 0 AND hbd.`is_refunded` = 0 - THEN hbd.`total_price_tax_excl` / o.`conversion_rate` ELSE 0 END) AS revenue_excl, - SUM(CASE WHEN hbd.`is_cancelled` = 0 AND hbd.`is_refunded` = 0 - THEN hbd.`total_price_tax_incl` / o.`conversion_rate` ELSE 0 END) AS revenue_incl, + COUNT(*) AS rooms_booked, + SUM(DATEDIFF(hbd.`date_to`, hbd.`date_from`)) AS room_nights, + SUM(hbd.`total_price_tax_excl` / o.`conversion_rate`) AS revenue_excl, + SUM(hbd.`total_price_tax_incl` / o.`conversion_rate`) AS revenue_incl, MAX(o.`total_discounts_tax_excl` / o.`conversion_rate`) AS discount_amount, IFNULL(MAX(ord_ref.`refunded_total`), 0) AS refund_amount, COUNT(*) AS total_rooms, - SUM(CASE WHEN hbd.`is_refunded` = 1 THEN 1 ELSE 0 END) AS cancelled_rooms + SUM(CASE WHEN hbd.`id_status` = '.(int) self::STATUS_CANCELLED.' THEN 1 ELSE 0 END) AS cancelled_rooms FROM `'._DB_PREFIX_.'htl_booking_detail` hbd INNER JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order` AND o.`valid` = 1) LEFT JOIN ( @@ -4390,9 +4378,7 @@ class HotelBookingDetail extends ObjectModel IFNULL(SUM(hbd.`total_price_tax_incl` / o.`conversion_rate`), 0) AS revenue_incl FROM `'._DB_PREFIX_.'htl_booking_detail` hbd INNER JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order` AND o.`valid` = 1) - WHERE hbd.`is_cancelled` = 0 - AND hbd.`is_refunded` = 0 - AND hbd.`date_add` BETWEEN "'.$dateFrom.' 00:00:00" AND "'.$dateTo.' 23:59:59"' + WHERE hbd.`date_add` BETWEEN "'.$dateFrom.' 00:00:00" AND "'.$dateTo.' 23:59:59"' .($idCustomer ? ' AND hbd.`id_customer` = '.$idCustomer : '') .($bookingType ? ' AND hbd.`booking_type` = '.$bookingType : '') .HotelBranchInformation::addHotelRestriction($idsHotel, 'hbd').' @@ -4433,7 +4419,7 @@ class HotelBookingDetail extends ObjectModel INNER JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order` AND o.`valid` = 1) INNER JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = hbd.`id_customer`) INNER JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = hbd.`id_order_detail`) - INNER JOIN `'._DB_PREFIX_.'order_detail_tax` odt ON (odt.`id_order_detail` = od.`id_order_detail`) + INNER JOIN `'._DB_PREFIX_.'order_tax_detail` odt ON (odt.`id_order_detail` = od.`id_order_detail`) INNER JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = odt.`id_tax`) LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (tl.`id_tax` = t.`id_tax` AND tl.`id_lang` = '.(int) $idLang.') WHERE hbd.`date_add` BETWEEN "'.$dateFrom.' 00:00:00" AND "'.$dateTo.' 23:59:59"' @@ -4461,7 +4447,7 @@ class HotelBookingDetail extends ObjectModel /** * Refunded booking rows in a date range, one row per booking (requires ORDER RETURN record). - * QloApps sets is_refunded=1 on all freed/refunded rooms; is_cancelled is not reliably set. + * A booking only appears here once it has a matching order_return_detail row. * Refund report filters this further to refunded_amount > 0 in the caller; Cancellation report shows all rows. * * @param array $params date_from, date_to, id_hotel, id_customer, id_product, detailed_info @@ -4511,8 +4497,7 @@ class HotelBookingDetail extends ObjectModel ON (orsl.`id_order_return_state` = orr.`state` AND orsl.`id_lang` = '.(int) $idLang.') LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = hbd.`id_customer`) LEFT JOIN `'._DB_PREFIX_.'order_slip` os ON (os.`id_order` = orr.`id_order`) - WHERE hbd.`is_refunded` = 1 - AND orr.`date_add` BETWEEN "'.$dateFrom.' 00:00:00" AND "'.$dateTo.' 23:59:59"' + WHERE orr.`date_add` BETWEEN "'.$dateFrom.' 00:00:00" AND "'.$dateTo.' 23:59:59"' . ($idCustomer ? ' AND hbd.`id_customer` = '.$idCustomer : '') . ($idProduct ? ' AND hbd.`id_product` = '.$idProduct : '') . HotelBranchInformation::addHotelRestriction($idsHotel, 'hbd').' @@ -4598,8 +4583,6 @@ class HotelBookingDetail extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`) WHERE p.`active` = 1 AND o.`valid` = 1 - AND hbd.`is_refunded` = 0 - AND hbd.`is_cancelled` = 0 AND o.`invoice_date` BETWEEN "'.$dateFrom.' 00:00:00" AND "'.$dateTo.' 23:59:59"' .($idProduct ? ' AND hbd.`id_product` = '.$idProduct : '') .($idRoom ? ' AND hbd.`id_room` = '.$idRoom : '') @@ -4666,7 +4649,6 @@ class HotelBookingDetail extends ObjectModel INNER JOIN `'._DB_PREFIX_.'htl_room_information` hri ON (hri.`id` = hbd.`id_room`) INNER JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hri.`id_product`) WHERE p.`active` = 1 - AND hbd.`is_cancelled` = 0 AND hbd.`date_from` < "'.pSQL($dateNext).' 00:00:00" AND hbd.`date_to` > "'.pSQL($dateTemp).' 00:00:00"' .$statusFilter diff --git a/modules/hotelreservationsystem/classes/HotelRoomInformation.php b/modules/hotelreservationsystem/classes/HotelRoomInformation.php index 08708b8b1..84664b43e 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomInformation.php +++ b/modules/hotelreservationsystem/classes/HotelRoomInformation.php @@ -373,8 +373,7 @@ class HotelRoomInformation extends ObjectModel 'SELECT hbd.`id_product`, hbd.`id_room`, hbd.`date_from`, hbd.`date_to` FROM `'._DB_PREFIX_.'htl_booking_detail` hbd INNER JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order` AND o.`valid` = 1) - WHERE hbd.`is_refunded` = 0 AND hbd.`is_cancelled` = 0 - AND hbd.`date_from` < "'.$dateToNext.'" AND hbd.`date_to` > "'.$dateFrom.'"' + WHERE hbd.`date_from` < "'.$dateToNext.'" AND hbd.`date_to` > "'.$dateFrom.'"' .HotelBranchInformation::addHotelRestriction($idsHotel, 'hbd') .($idProduct ? ' AND hbd.`id_product` = '.$idProduct : '') ); @@ -472,8 +471,7 @@ class HotelRoomInformation extends ObjectModel MIN(hbd.`id_status`) AS `id_status`, MIN(hbd.`id_customer`) AS `id_customer` FROM `'._DB_PREFIX_.'htl_booking_detail` hbd - WHERE hbd.`is_refunded` = 0 - AND hbd.`date_from` < "'.$dateToNext.'" AND hbd.`date_to` > "'.$dateFrom.'" + WHERE hbd.`date_from` < "'.$dateToNext.'" AND hbd.`date_to` > "'.$dateFrom.'" GROUP BY hbd.`id_room` ) bkgs ON (bkgs.`id_room` = hri.`id`) LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = bkgs.`id_customer`) diff --git a/modules/hotelreservationsystem/classes/HotelRoomType.php b/modules/hotelreservationsystem/classes/HotelRoomType.php index 0d2e101c8..59ba5a540 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomType.php +++ b/modules/hotelreservationsystem/classes/HotelRoomType.php @@ -558,11 +558,11 @@ class HotelRoomType extends ObjectModel FROM `'._DB_PREFIX_.'htl_room_information` r WHERE r.`id_product` = hrt.`id_product` AND r.`id_hotel` = hrt.`id_hotel` ) AS total_rooms, - COUNT(CASE WHEN hbd.`is_cancelled` = 0 AND hbd.`is_refunded` = 0 THEN hbd.`id` END) AS bookings, - IFNULL(SUM(CASE WHEN hbd.`is_cancelled` = 0 AND hbd.`is_refunded` = 0 THEN DATEDIFF(hbd.`date_to`, hbd.`date_from`) ELSE 0 END), 0) AS room_nights, - IFNULL(SUM(CASE WHEN hbd.`is_cancelled` = 0 AND hbd.`is_refunded` = 0 THEN hbd.`total_price_tax_excl` / o.`conversion_rate` ELSE 0 END), 0) AS room_revenue, - IFNULL(SUM(CASE WHEN hbd.`is_cancelled` = 0 AND hbd.`is_refunded` = 0 THEN (hbd.`total_price_tax_incl` - hbd.`total_price_tax_excl`) / o.`conversion_rate` ELSE 0 END), 0) AS tax_amount, - COUNT(CASE WHEN hbd.`is_refunded` = 1 THEN hbd.`id` END) AS cancel_count + COUNT(hbd.`id`) AS bookings, + IFNULL(SUM(DATEDIFF(hbd.`date_to`, hbd.`date_from`)), 0) AS room_nights, + IFNULL(SUM(hbd.`total_price_tax_excl` / o.`conversion_rate`), 0) AS room_revenue, + IFNULL(SUM((hbd.`total_price_tax_incl` - hbd.`total_price_tax_excl`) / o.`conversion_rate`), 0) AS tax_amount, + COUNT(CASE WHEN hbd.`id_status` = '.(int) HotelBookingDetail::STATUS_CANCELLED.' THEN hbd.`id` END) AS cancel_count FROM `'._DB_PREFIX_.'htl_room_type` hrt INNER JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hrt.`id_product`) INNER JOIN `'._DB_PREFIX_.'product_lang` pl diff --git a/modules/hotelreservationsystem/classes/ServiceProductOrderDetail.php b/modules/hotelreservationsystem/classes/ServiceProductOrderDetail.php index 713045f68..2c9bf3517 100644 --- a/modules/hotelreservationsystem/classes/ServiceProductOrderDetail.php +++ b/modules/hotelreservationsystem/classes/ServiceProductOrderDetail.php @@ -661,7 +661,6 @@ class ServiceProductOrderDetail extends ObjectModel $baseWhere = 'WHERE p.`active` = 1 AND o.`valid` = 1 - AND hbd.`is_refunded` = 0 AND spod.`is_cancelled` = 0 AND o.`invoice_date` BETWEEN "'.$dateFrom.' 00:00:00" AND "'.$dateTo.' 23:59:59"' .($idProduct ? ' AND hbd.`id_product` = '.$idProduct : '') @@ -714,7 +713,6 @@ class ServiceProductOrderDetail extends ObjectModel $baseWhere = 'WHERE p.`active` = 1 AND o.`valid` = 1 - AND hbd.`is_refunded` = 0 AND spod.`is_cancelled` = 0 AND o.`invoice_date` BETWEEN "'.$dateFrom.' 00:00:00" AND "'.$dateTo.' 23:59:59"' .($idProduct ? ' AND hbd.`id_product` = '.$idProduct : '') @@ -883,7 +881,6 @@ class ServiceProductOrderDetail extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (tl.`id_tax` = t.`id_tax` AND tl.`id_lang` = '.(int) $idLang.') WHERE spod.`is_cancelled` = 0 - AND hbd.`is_refunded` = 0 AND (spod.`total_price_tax_incl` - spod.`total_price_tax_excl`) > 0 AND spod.`date_add` BETWEEN "'.$dateFrom.' 00:00:00" AND "'.$dateTo.' 23:59:59"' .($idTax ? ' AND t.`id_tax` = '.$idTax : '') diff --git a/modules/qlohotelreports/qlohotelreports.php b/modules/qlohotelreports/qlohotelreports.php index 4ed7522ab..70fe02384 100644 --- a/modules/qlohotelreports/qlohotelreports.php +++ b/modules/qlohotelreports/qlohotelreports.php @@ -182,7 +182,7 @@ class QloHotelReports extends Module 'filter_booking_type' => $bookingType, 'filter_id_order_state' => $idOrderState, 'booking_statuses' => array( - HotelBookingDetail::STATUS_ALLOTED => $this->l('Allotted'), + HotelBookingDetail::STATUS_ASSIGNED => $this->l('Allotted'), HotelBookingDetail::STATUS_CHECKED_IN => $this->l('Checked In'), HotelBookingDetail::STATUS_CHECKED_OUT => $this->l('Checked Out'), ), @@ -358,7 +358,7 @@ class QloHotelReports extends Module OrderPayment::PAYMENT_TYPE_REMOTE_PAYMENT => $this->l('Remote Payment'), ), 'booking_statuses' => array( - HotelBookingDetail::STATUS_ALLOTED => $this->l('Allotted'), + HotelBookingDetail::STATUS_ASSIGNED => $this->l('Allotted'), HotelBookingDetail::STATUS_CHECKED_IN => $this->l('Checked In'), HotelBookingDetail::STATUS_CHECKED_OUT => $this->l('Checked Out'), ), @@ -573,7 +573,7 @@ class QloHotelReports extends Module if ($report === 'occupancy') { $dailyOccupied = HotelBookingDetail::getDatewiseOccupiedRooms($baseParams); $dailyBooked = HotelBookingDetail::getDatewiseOccupiedRooms( - array_merge($baseParams, array('id_status' => HotelBookingDetail::STATUS_ALLOTED)) + array_merge($baseParams, array('id_status' => HotelBookingDetail::STATUS_ASSIGNED)) ); $dailyCheckedIn = HotelBookingDetail::getDatewiseOccupiedRooms( array_merge($baseParams, array('id_status' => HotelBookingDetail::STATUS_CHECKED_IN)) @@ -1100,7 +1100,7 @@ class QloHotelReports extends Module $this->attachCurrencyToRows($rows, $csvCurrencyMap, $defaultCurrency->iso_code); $statusLabels = array( - HotelBookingDetail::STATUS_ALLOTED => $this->l('Allotted'), + HotelBookingDetail::STATUS_ASSIGNED => $this->l('Allotted'), HotelBookingDetail::STATUS_CHECKED_IN => $this->l('Checked In'), HotelBookingDetail::STATUS_CHECKED_OUT => $this->l('Checked Out'), ); @@ -1478,7 +1478,7 @@ class QloHotelReports extends Module $totalRoomsOcc = (int) AdminStatsController::getTotalRooms($idHotel ?: null, 1, $idProduct ?: null); $dailyAllOcc = HotelBookingDetail::getDatewiseOccupiedRooms($baseParams); $dailyBooked = HotelBookingDetail::getDatewiseOccupiedRooms( - array_merge($baseParams, array('id_status' => HotelBookingDetail::STATUS_ALLOTED)) + array_merge($baseParams, array('id_status' => HotelBookingDetail::STATUS_ASSIGNED)) ); $dailyCheckedIn = HotelBookingDetail::getDatewiseOccupiedRooms( array_merge($baseParams, array('id_status' => HotelBookingDetail::STATUS_CHECKED_IN))