diff --git a/controllers/admin/AdminStatsController.php b/controllers/admin/AdminStatsController.php index 8fe1be370..77bb9bcb5 100644 --- a/controllers/admin/AdminStatsController.php +++ b/controllers/admin/AdminStatsController.php @@ -1176,9 +1176,10 @@ class AdminStatsControllerCore extends AdminStatsTabController public static function getArrivalsInfoByDate($date, $idHotel = null) { - $sql = 'SELECT hbd.*, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, + $sql = 'SELECT hbd.*, o.`with_occupancy`, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, DATEDIFF(hbd.`date_to`, hbd.`date_from`) AS los 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_from` = "'.pSQL($date).' 00:00:00" AND hbd.`id_status` != '.(int) HotelBookingDetail::STATUS_CHECKED_IN.' @@ -1191,9 +1192,10 @@ class AdminStatsControllerCore extends AdminStatsTabController public static function getDeparturesInfoByDate($date, $idHotel = null) { - $sql = 'SELECT hbd.*, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, + $sql = 'SELECT hbd.*, o.`with_occupancy`, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, DATEDIFF(hbd.`date_to`, hbd.`date_from`) AS los 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` = "'.pSQL($date).' 00:00:00" AND hbd.`id_status` = '.(int) HotelBookingDetail::STATUS_CHECKED_IN. @@ -1205,9 +1207,10 @@ class AdminStatsControllerCore extends AdminStatsTabController public static function getInHousesInfo($idHotel = null) { - $sql = 'SELECT hbd.*, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, + $sql = 'SELECT hbd.*, o.`with_occupancy`, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, DATEDIFF(hbd.`date_to`, hbd.`date_from`) AS los 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` = '.(int) HotelBookingDetail::STATUS_CHECKED_IN. (!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : ''); @@ -1220,7 +1223,7 @@ class AdminStatsControllerCore extends AdminStatsTabController { $sql = 'SELECT hbd.`id_customer`, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, COUNT(hbd.`id`) AS total_rooms, SUM(hbd.`adults` + hbd.`children`) AS total_guests, - hbd.`id_hotel`, hbd.`hotel_name`, hbd.`id_order`, o.`total_paid_tax_excl`, o.`id_currency`, osl.`name` AS `state_name` + hbd.`id_hotel`, hbd.`hotel_name`, hbd.`id_order`, o.`with_occupancy`, o.`total_paid_tax_excl`, o.`id_currency`, osl.`name` AS `state_name` FROM `'._DB_PREFIX_.'htl_booking_detail` hbd LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`) LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl @@ -1237,8 +1240,8 @@ class AdminStatsControllerCore extends AdminStatsTabController public static function getCancellationsInfoByDate($date, $idHotel = null) { $sql = 'SELECT orr.`id_order_return`, orr.`id_customer`, hbd.`room_num`, hbd.`id_product`, hbd.`room_type_name`, - CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, - hbd.`id_hotel`, hbd.`hotel_name`, SUM(hbd.`adults` + hbd.`children`) AS total_guests, + o.`with_occupancy`, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, hbd.`id_hotel`, + hbd.`hotel_name`, SUM(hbd.`adults` + hbd.`children`) AS total_guests, hbd.`date_from`, hbd.`date_to`, orr.`id_order` FROM `'._DB_PREFIX_.'order_return` orr LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ord ON (ord.`id_order_return` = orr.`id_order_return`) diff --git a/modules/dashguestcycle/dashguestcycle.php b/modules/dashguestcycle/dashguestcycle.php index 7eb15b98e..783ac20e4 100644 --- a/modules/dashguestcycle/dashguestcycle.php +++ b/modules/dashguestcycle/dashguestcycle.php @@ -170,7 +170,7 @@ class DashGuestCycle extends Module } $tr[] = array( - 'value' => $arrivalInfo['adults'] + $arrivalInfo['children'], + 'value' => $arrivalInfo['with_occupancy'] ? ($arrivalInfo['adults'] + $arrivalInfo['children']) : '--', 'class' => 'text-center', ); $tr[] = array( @@ -230,7 +230,7 @@ class DashGuestCycle extends Module } $tr[] = array( - 'value' => $departureInfo['adults'] + $departureInfo['children'], + 'value' => $departureInfo['with_occupancy'] ? ($departureInfo['adults'] + $departureInfo['children']) : '--', 'class' => 'text-center', ); $tr[] = array( @@ -291,7 +291,7 @@ class DashGuestCycle extends Module } $tr[] = array( - 'value' => $inHouseInfo['adults'] + $inHouseInfo['children'], + 'value' => $inHouseInfo['with_occupancy'] ? ($inHouseInfo['adults'] + $inHouseInfo['children']) : '--', 'class' => 'text-center', ); $tr[] = array( @@ -357,7 +357,7 @@ class DashGuestCycle extends Module 'class' => 'text-center', ); $tr[] = array( - 'value' => $newBookingInfo['total_guests'], + 'value' => $newBookingInfo['with_occupancy'] ? $newBookingInfo['total_guests'] : '--', 'class' => 'text-center', ); $tr[] = array( @@ -425,7 +425,7 @@ class DashGuestCycle extends Module } $tr[] = array( - 'value' => $cancellationInfo['total_guests'], + 'value' => $cancellationInfo['with_occupancy'] ? $cancellationInfo['total_guests'] : '--', 'class' => 'text-center', ); $tr[] = array(