Merge branch 'develop' into gli-2599_2

This commit is contained in:
vishalsingh.qlo325
2025-06-12 18:57:12 +05:30
54 changed files with 532 additions and 360 deletions

View File

@@ -986,14 +986,12 @@ class AdminOrdersControllerCore extends AdminController
}
if ($serviceProducts) {
if ($additionalServices) {
foreach ($serviceProducts as $key => $servProduct) {
$serviceProducts[$key]['price_tax_exc'] = $servProduct['price'];
if (isset($additionalServices[$productLineData['id']])
&& in_array($servProduct['id_product'], array_column($additionalServices[$productLineData['id']]['additional_services'], 'id_product'))
) {
unset($serviceProducts[$key]);
}
foreach ($serviceProducts as $key => $servProduct) {
$serviceProducts[$key]['price_tax_exc'] = $servProduct['price'];
if (isset($additionalServices[$productLineData['id']])
&& in_array($servProduct['id_product'], array_column($additionalServices[$productLineData['id']]['additional_services'], 'id_product'))
) {
unset($serviceProducts[$key]);
}
}
@@ -1017,6 +1015,7 @@ class AdminOrdersControllerCore extends AdminController
$smartyVars['taxRulesGroups'] = $taxRulesGroups;
$smartyVars['invoices_collection'] = $objOrder->getInvoicesCollection();
$smartyVars['customServiceAllowed'] = Configuration::get('PS_ALLOW_CREATE_CUSTOM_SERVICES_IN_BOOKING');
$smartyVars['current_id_lang'] = $this->context->language->id;
$this->context->smarty->assign($smartyVars);
@@ -1124,6 +1123,7 @@ class AdminOrdersControllerCore extends AdminController
$this->context->smarty->assign(
array(
'order' => $objOrder,
'currency' => new Currency($objOrder->id_currency),
'current_index' => self::$currentIndex,
'bookingOrderInfo' => $bookingOrderInfo,
'serviceProducts' => array_merge($hotelProducts, $standaloneProducts)
@@ -2024,6 +2024,11 @@ class AdminOrdersControllerCore extends AdminController
$this->context->currency = new Currency((int)$objCart->id_currency);
$this->errors = HotelCartBookingData::validateCartBookings(!Configuration::get('PS_ALLOW_ADD_ALL_SERVICES_IN_BOOKING'));
// Remove cart rules and add if any changes
CartRule::autoRemoveFromCart($this->context);
CartRule::autoAddToCart($this->context);
$orderTotal = $objCart->getOrderTotal(true, Cart::BOTH);
if ($objCart->is_advance_payment) {
$advancePaymentAmount = $objCart->getOrderTotal(true, Cart::ADVANCE_PAYMENT);
@@ -2849,10 +2854,36 @@ class AdminOrdersControllerCore extends AdminController
$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->href = '#start_rooms';
$helper->value = $numRooms;
$this->kpis[] = $helper;
// if order has normal products the add kpi for total products
$objServiceProductOrderDetail = new ServiceProductOrderDetail();
$hotelProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($objOrder->id, 0, 0, Product::SELLING_PREFERENCE_HOTEL_STANDALONE);
$standaloneProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($objOrder->id, 0, 0, Product::SELLING_PREFERENCE_STANDALONE);
if ($hotelProducts || $standaloneProducts) {
$helper = new HelperKpi();
$helper->id = 'box-total-products';
$helper->icon = 'icon-home';
$helper->color = 'color1';
$helper->title = $this->l('Total Products');
$helper->tooltip = $this->l('Total products is the number of product quantities booked in this order.');
$helper->href = '#start_products';
$totalProductQuantity = 0;
if ($hotelProducts) {
$totalProductQuantity += array_sum(array_column($hotelProducts, 'quantity'));
}
if ($standaloneProducts) {
$totalProductQuantity += array_sum(array_column($standaloneProducts, 'quantity'));
}
$helper->value = $totalProductQuantity;
$this->kpis[] = $helper;
}
$helper = new HelperKpi();
if (isset($orderHistory[0]['id_order_state']) && ($orderHistory[0]['id_order_state'] == Configuration::get('PS_OS_PAYMENT_ACCEPTED'))) {
$initialPaymentStatus = $this->l('Full Payment');
@@ -3266,7 +3297,7 @@ class AdminOrdersControllerCore extends AdminController
0,
0,
null,
0,
null,
null,
0,
$value['id']
@@ -6125,6 +6156,9 @@ class AdminOrdersControllerCore extends AdminController
// Save order invoice
if (isset($objOrderInvoice)) {
$objOrderInvoice->total_products_wt -= $diffPriceTaxIncl;
$objOrderInvoice->total_paid_tax_excl += $diffPriceTaxExcl;
$objOrderInvoice->total_paid_tax_incl += $diffPriceTaxIncl;
$result &= $objOrderInvoice->update();
}
@@ -6221,7 +6255,7 @@ class AdminOrdersControllerCore extends AdminController
0,
1,
1,
0,
null, // to get the auto added services.
null,
0,
$idHotelBooking
@@ -6237,7 +6271,7 @@ class AdminOrdersControllerCore extends AdminController
0,
1,
0,
0,
null, // to get the auto added services.
null,
0,
$idHotelBooking
@@ -6253,7 +6287,7 @@ class AdminOrdersControllerCore extends AdminController
0,
0,
null,
0,
null, // to get the auto added services.
null,
0,
$idHotelBooking
@@ -7662,7 +7696,7 @@ class AdminOrdersControllerCore extends AdminController
$objHotelBookingDetail->date_to,
$objHotelBookingDetail->id_room
)) {
$name = Tools::getValue('new_service_name');
$name = trim(Tools::getValue('new_service_name'));
$price = Tools::getValue('new_service_price');
$priceCalcMethod = Tools::getValue('new_service_price_calc_method');
$priceAdditionType = Tools::getValue('new_service_price_addition_type');