Fixed: Booking KPIs data in backoffice order list page
This commit is contained in:
@@ -2496,7 +2496,8 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$helper->icon = 'icon-money';
|
||||
$helper->color = 'color2';
|
||||
$helper->title = $this->l('Total Due Amount', null, null, false);
|
||||
$helper->href = $this->context->link->getAdminLink('AdminOrders').'&submitResetorder=1&due_amount_orders=1';
|
||||
$minValue = (float)('0.' . str_repeat('0', (Configuration::get('PS_PRICE_DISPLAY_PRECISION') - 1)) . '1');
|
||||
$helper->href = $this->context->link->getAdminLink('AdminOrders').'&submitFilterorder=1&orderFilter_amount_due%5B0%5D='.$minValue;
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=total_due_amount';
|
||||
$helper->tooltip = $this->l('Total due amount of all the orders created.', null, null, false);
|
||||
$this->kpis[] = $helper;
|
||||
|
||||
@@ -851,7 +851,7 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
AND "'.pSQL(date('Y-m-d')).' 23:59:59" AND os.`logable` = 1 AND EXISTS (
|
||||
SELECT 1
|
||||
FROM `qlo_htl_booking_detail` hbd
|
||||
WHERE hbd.`id_order` = o.`id_order`' . HotelBranchInformation::addHotelRestriction($idHotel).'
|
||||
WHERE hbd.`id_order` = o.`id_order`' . HotelBranchInformation::addHotelRestriction($idHotels).'
|
||||
)');
|
||||
$value = Tools::displayPrice($row['orders'] ? $row['total_paid_tax_excl'] / $row['orders'] : 0, $currency).' ('.$this->l('tax excl.').')';
|
||||
|
||||
@@ -1036,7 +1036,7 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
break;
|
||||
case 'total_due_amount':
|
||||
$dateToday = date('Y-m-d');
|
||||
$dueAmount = AdminStatsController::getTotalDueAmount('', '', $idHotels, 1);
|
||||
$dueAmount = AdminStatsController::getTotalDueAmount('', '', $idHotels);
|
||||
if ($dueAmount > 0) {
|
||||
$value = Tools::displayPrice($dueAmount, $currency);
|
||||
} else {
|
||||
@@ -2426,7 +2426,7 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
$objHotelBooking = new HotelBookingDetail();
|
||||
$invalidOrderStates = $objHotelBooking->getOrderStatusToFreeBookedRoom();
|
||||
|
||||
$sql = 'SELECT ' . ($useTax ? 'SUM(o.`total_paid_tax_incl` / o.`conversion_rate`)' : 'SUM(o.`total_paid_tax_excl` / o.`conversion_rate`)') . ' - SUM(o.`total_paid_real` / o.`conversion_rate`)
|
||||
$sql = 'SELECT SUM(IF(((o.`total_paid_tax_incl` / o.`conversion_rate`) - (o.`total_paid_real` / o.`conversion_rate`) > 0), ((o.`total_paid_tax_incl` / o.`conversion_rate`) - (o.`total_paid_real` / o.`conversion_rate`)), 0))
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_state` os ON o.current_state = os.id_order_state
|
||||
WHERE 1 ' .
|
||||
|
||||
Reference in New Issue
Block a user