Merge pull request #1124 from sumitwebkul/gli-2075
Added: New KPIs added in order view page in the Back-office
This commit is contained in:
@@ -2251,24 +2251,56 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-order-date';
|
||||
$helper->icon = 'icon-calendar';
|
||||
$helper->color = 'color3';
|
||||
$helper->color = 'color1';
|
||||
$helper->title = $this->l('Order Date');
|
||||
$helper->tooltip = $this->l('The date when the order was placed.');
|
||||
$helper->value = Tools::displayDate($objOrder->date_add);
|
||||
$kpis[] = $helper;
|
||||
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-order-total';
|
||||
$helper->icon = 'icon-money';
|
||||
$helper->color = 'color4';
|
||||
$helper->title = $this->l('Total');
|
||||
$helper->color = 'color3';
|
||||
$helper->title = $this->l('Bookings Total');
|
||||
$helper->tooltip = $this->l('Total booking amount of this order.');
|
||||
$helper->value = Tools::displayPrice($objOrder->total_paid_tax_incl, new Currency($objOrder->id_currency));
|
||||
$kpis[] = $helper;
|
||||
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-total-paid';
|
||||
$helper->icon = 'icon-money';
|
||||
$helper->color = 'color4';
|
||||
$helper->title = $this->l('Total Paid');
|
||||
$helper->tooltip = $this->l('Total paid is the amount which customer has already paid for this order.');
|
||||
$helper->value = Tools::displayPrice($objOrder->total_paid_real, new Currency($objOrder->id_currency));
|
||||
$kpis[] = $helper;
|
||||
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-total-due';
|
||||
$helper->icon = 'icon-money';
|
||||
$helper->color = 'color2';
|
||||
$helper->title = $this->l('Total Due');
|
||||
$helper->tooltip = $this->l('Total due is the amount which customer has to pay for this order.');
|
||||
$helper->value = Tools::displayPrice(($objOrder->total_paid_tax_incl - $objOrder->total_paid_real), new Currency($objOrder->id_currency));
|
||||
$kpis[] = $helper;
|
||||
|
||||
$orderHistory = array_reverse($objOrder->getHistory($this->context->language->id));
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-order-source';
|
||||
$helper->icon = 'icon-globe';
|
||||
$helper->color = 'color1';
|
||||
$helper->title = $this->l('Order Source');
|
||||
$helper->tooltip = $this->l('Order source shows from which source the order was placed.');
|
||||
$helper->subtitle = $orderHistory[0]['id_employee'] ? $this->l('Back office') : $this->l('Front office');
|
||||
$helper->value = $objOrder->source;
|
||||
$kpis[] = $helper;
|
||||
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-messages';
|
||||
$helper->icon = 'icon-comments';
|
||||
$helper->color = 'color2';
|
||||
$helper->title = $this->l('Messages');
|
||||
$helper->tooltip = $this->l('Messages is the number of customer messages for this order.');
|
||||
$helper->href = $this->context->link->getAdminLink('AdminCustomerThreads').'&id_order='.$objOrder->id;
|
||||
$helper->value = count(CustomerThread::getCustomerMessages($objOrder->id_customer, null, $objOrder->id));
|
||||
$kpis[] = $helper;
|
||||
@@ -2280,13 +2312,43 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$helper->icon = 'icon-home';
|
||||
$helper->color = 'color1';
|
||||
$helper->title = $this->l('Total Rooms');
|
||||
$helper->tooltip = $this->l('Total rooms is the number of rooms booked in this order.');
|
||||
$helper->href = '#start_products';
|
||||
$helper->value = $numRooms;
|
||||
$kpis[] = $helper;
|
||||
|
||||
Hook::exec('action'.$this->controller_name.'KPIListingModifier', array(
|
||||
'kpis' => &$kpis,
|
||||
));
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-payment-type';
|
||||
$helper->icon = 'icon-home';
|
||||
$helper->color = 'color3';
|
||||
$helper->title = $this->l('Payment Type');
|
||||
$helper->tooltip = $this->l('The payment type refers to the type of payment that customer selected while placing this order.');
|
||||
$helper->value = $objOrder->is_advance_payment ? $this->l('Partial Payment') : $this->l('Full Payment');
|
||||
$kpis[] = $helper;
|
||||
|
||||
if ($objOrder->is_advance_payment) {
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-partial-payment-amount';
|
||||
$helper->icon = 'icon-money';
|
||||
$helper->color = 'color4';
|
||||
$helper->title = $this->l('Partial Payment Amount');
|
||||
$helper->tooltip = $this->l('Partial payment amount refers to the amount that customer has to pay as advance payment, if payment type selected as partial payment while placing this order.');
|
||||
$helper->value = Tools::displayPrice($objOrder->advance_paid_amount, new Currency($objOrder->id_currency));
|
||||
$kpis[] = $helper;
|
||||
}
|
||||
|
||||
$objOrderReturn = new OrderReturn();
|
||||
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($objOrder->id, 0, 1)) {
|
||||
$refundedAmount = $objOrderReturn->getRefundedAmount($objOrder->id);
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-payment-type';
|
||||
$helper->icon = 'icon-money';
|
||||
$helper->color = 'color3';
|
||||
$helper->title = $this->l('Refunded Amount');
|
||||
$helper->tooltip = $this->l('Refunded amount refers to the amount that has been refunded for this order.');
|
||||
$helper->value = Tools::displayPrice($refundedAmount, new Currency($objOrder->id_currency));
|
||||
$kpis[] = $helper;
|
||||
}
|
||||
} else {
|
||||
$time = time();
|
||||
$kpis = array();
|
||||
@@ -2401,6 +2463,10 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$kpis[] = $helper;
|
||||
}
|
||||
|
||||
Hook::exec('action'.$this->controller_name.'KPIListingModifier', array(
|
||||
'kpis' => &$kpis,
|
||||
));
|
||||
|
||||
$helper = new HelperKpiRow();
|
||||
$helper->kpis = $kpis;
|
||||
return $helper->generate();
|
||||
|
||||
Reference in New Issue
Block a user