Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated: The stay overs KPI with occupied KPI in AdminDashboard and in AdminOrders controller in back office. #1363

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions controllers/admin/AdminOrdersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2587,11 +2587,11 @@ public function renderKpis()
$helper->id = 'box-today-stay-over';
$helper->icon = 'icon-user';
$helper->color = 'color4';
$helper->title = $this->l('Stay Overs', null, null, false);
$helper->title = $this->l('Occupied Rooms', null, null, false);
$helper->subtitle = $this->l('Today', null, null, false);
$helper->href = $this->context->link->getAdminLink('AdminOrders').'&submitResetorder&submitFilterorder=1&orderFilter_hbd!is_refunded=0&orderFilter_hbd!id_status='.HotelBookingDetail::STATUS_CHECKED_IN.'&orderFilter_hbd!date_to[]='.pSQL(date('Y-m-d', strtotime('+ 1 days'))).'&orderFilter_hbd!date_to[]=';
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=today_stay_over';
$helper->tooltip = $this->l('Total number of stay overs for today.', null, null, false);
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=occupied_rooms';
$helper->tooltip = $this->l('The count of rooms that are currently occupied by guests.', null, null, false);
$this->kpis[] = $helper;

$helper = new HelperKpi();
Expand Down
9 changes: 7 additions & 2 deletions modules/dashguestcycle/dashguestcycle.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function hookDashboardData($params)
$dataValue['dgc_total_departures'] = sprintf('%02d', rand(100, 1000));
$dataValue['dgc_departed'] = sprintf('%02d', rand(0, $dataValue['dgc_total_departures']));
$dataValue['dgc_new_bookings'] = sprintf('%02d', rand(10, 500));
$dataValue['dgc_stay_overs'] = sprintf('%02d', rand(10, 500));
$dataValue['dgc_occupied'] = sprintf('%02d', rand(10, 500));
$dataValue['dgc_new_messages'] = sprintf('%02d', rand(0, 20));
$dataValue['dgc_cancelled_bookings'] = sprintf('%02d', rand(0, 20));
$dataValue['dgc_guests_adults'] = sprintf('%02d', rand(100, 1000));
Expand All @@ -94,7 +94,12 @@ public function hookDashboardData($params)
$dataValue['dgc_departed'] = sprintf('%02d', $departuresData['departed']);
$dataValue['dgc_total_departures'] = sprintf('%02d', $departuresData['total_departures']);
$dataValue['dgc_new_bookings'] = sprintf('%02d', count(AdminStatsController::getNewBookingsInfoByDate($dateToday, $params['id_hotel'])));
$dataValue['dgc_stay_overs'] = sprintf('%02d', AdminStatsController::getStayOversByDate($dateToday, $params['id_hotel']));
$dataValue['dgc_occupied'] = sprintf('%02d', AdminStatsController::getDistinctRoomBookingsCount(
date('Y-m-d', strtotime('-1 day')),
$dateToday,
$params['id_hotel'],
HotelBookingDetail::STATUS_CHECKED_IN
));
$dataValue['dgc_new_messages'] = sprintf('%02d', CustomerMessage::getMessagesByDate($dateToday));
$dataValue['dgc_cancelled_bookings'] = sprintf('%02d', AdminStatsController::getCancelledBookingsByDate($dateToday, $params['id_hotel']));
$dataValue['dgc_guests_adults'] = sprintf('%02d', $guestsData['adults']);
Expand Down
6 changes: 3 additions & 3 deletions modules/dashguestcycle/views/templates/hook/dashboard-top.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@
</div>
</div>
<div class="badge-wrapper">
<div class="badge-item label-tooltip" data-toggle="tooltip" data-original-title="{l s='The number of stay overs scheduled for today.' mod='dashguestcycle'}">
<div class="badge-item label-tooltip" data-toggle="tooltip" data-original-title="{l s='The count of rooms that are currently occupied by guests.' mod='dashguestcycle'}">
<div class="badge-strip" style="background-color: #FFC148;"></div>
<div class="badge-content-wrapper">
<div class="title-wrapper">
<p class="text-center">{l s="Stay Overs" mod='dashguestcycle'}</p>
<p class="text-center">{l s='Occupied Rooms' mod='dashguestcycle'}</p>
</div>
<div class="value-wrapper">
<p class="text-center">
<span id="dgc_stay_overs"></span>
<span id="dgc_occupied"></span>
</p>
</div>
</div>
Expand Down