Merge branch 'develop' into gli-1782

This commit is contained in:
vishalsingh.qlo325
2024-05-15 19:28:42 +05:30
13 changed files with 31 additions and 27 deletions

View File

@@ -2407,7 +2407,8 @@ class CartCore extends ObjectModel
$product['cart_quantity'] = $selectedProduct['quantity'];
$product['total'] = $selectedProduct['total_price_tax_excl'];
$product['total_wt'] = $selectedProduct['total_price_tax_incl'];
$product['price_wt'] = $selectedProduct['unit_price_tax_incl'];
$product['price_wt'] = $selectedProduct['total_price_tax_incl'] / $product['cart_quantity'];
$product['price'] = $selectedProduct['total_price_tax_excl'] / $product['cart_quantity'];
$product['id_hotel'] = $selectedProduct['id_hotel'];
$orderPackage[$id_address][$selectedProduct['id_hotel']]['product_list'][] = $product;
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_hotel'])) {

View File

@@ -449,7 +449,7 @@ class OrderHistoryCore extends ObjectModel
);
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) {
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $order->id_lang);
$objHotelBranchInformation = new HotelBranchInformation($idHotel);
$fields = array_merge(
$objHotelBranchInformation->getFields(),
$objHotelBranchInformation->getFieldsLang()[$order->id_lang],

View File

@@ -45,8 +45,8 @@ class AdminCartsControllerCore extends AdminController
$this->_select = 'CONCAT(c.`firstname`, \' \', c.`lastname`) `customer`, a.id_cart total,
TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) AS `time_diff`,
IFNULL(GROUP_CONCAT(o.`id_order`), 0) AS `ids_order`,
IF (IFNULL(o.id_order, \''.$this->l('Non ordered cart').'\') = \''.$this->l('Non ordered cart').'\', IF(TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) > 86400, \''.$this->l('Abandoned cart').'\', \''.$this->l('Non ordered cart').'\'), GROUP_CONCAT(o.`id_order`)) AS filter_ids_order,
IFNULL(GROUP_CONCAT(DISTINCT o.`id_order`), 0) AS `ids_order`,
IF (IFNULL(o.id_order, \''.$this->l('Non ordered cart').'\') = \''.$this->l('Non ordered cart').'\', IF(TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) > 86400, \''.$this->l('Abandoned cart').'\', \''.$this->l('Non ordered cart').'\'), GROUP_CONCAT(DISTINCT o.`id_order`)) AS filter_ids_order,
IF(o.id_order, 1, 0) badge_success, IF(o.id_order, 0, 1) badge_danger, IF(co.id_guest, 1, 0) id_guest';
$this->_join = 'LEFT JOIN '._DB_PREFIX_.'customer c ON (c.id_customer = a.id_customer)
LEFT JOIN '._DB_PREFIX_.'currency cu ON (cu.id_currency = a.id_currency)

View File

@@ -3079,7 +3079,7 @@ class AdminNormalProductsControllerCore extends AdminController
} else {
$address->id_country = (int)$address_infos['id_country'];
$address->id_state = (int)$address_infos['id_state'];
$address->zipcode = $address_infos['postcode'];
$address->postcode = $address_infos['postcode'];
}
$tax_rules_groups = TaxRulesGroup::getTaxRulesGroups(true);
$tax_rates = array(

View File

@@ -1089,16 +1089,18 @@ class AdminProductsControllerCore extends AdminController
}
$id_product = Tools::getValue('id_product');
$id_adv_pmt = Tools::getValue('id_adv_pmt');
if ($id_adv_pmt) {
$obj_adv_pmt = new HotelAdvancedPayment($id_adv_pmt);
} else {
$obj_adv_pmt = new HotelAdvancedPayment();
if ($adv_pmt_info = $obj_adv_pmt->getIdAdvPaymentByIdProduct($id_product)) {
// To prevent duplication from two separate tabs
$obj_adv_pmt = new HotelAdvancedPayment((int) $adv_pmt_info['id']);
}
}
$adv_payment_active = Tools::getValue('adv_payment_active');
$obj_adv_pmt->id_product = $id_product;
$obj_adv_pmt->active = $adv_payment_active;
@@ -3178,12 +3180,8 @@ class AdminProductsControllerCore extends AdminController
$objRoomTypeServiceProductPrice->id_element = $idProduct;
$objRoomTypeServiceProductPrice->element_type = RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE;
}
$objRoomTypeServiceProductPrice->price = $price;
if ($idTaxRulesGroup) {
$objRoomTypeServiceProductPrice->id_tax_rules_group = $idTaxRulesGroup;
}
$objRoomTypeServiceProductPrice->id_tax_rules_group = $idTaxRulesGroup;
$objRoomTypeServiceProductPrice->save();
} else {
// create new association
@@ -3910,7 +3908,7 @@ class AdminProductsControllerCore extends AdminController
} else {
$address->id_country = (int)$address_infos['id_country'];
$address->id_state = (int)$address_infos['id_state'];
$address->zipcode = $address_infos['postcode'];
$address->postcode = $address_infos['postcode'];
}
$tax_rules_groups = TaxRulesGroup::getTaxRulesGroups(true);

View File

@@ -92,10 +92,11 @@ class GuestTrackingControllerCore extends FrontController
$customer = new Customer((int)$order->id_customer);
if (!Validate::isLoadedObject($customer)) {
$this->errors[] = Tools::displayError('Invalid customer');
} elseif (!Tools::getValue('password')) {
} elseif (!Tools::getValue('password')
|| !Validate::isPasswd(Tools::getValue('password')
)) {
$this->errors[] = Tools::displayError('Invalid password.');
} elseif (!$customer->transformToCustomer($this->context->language->id, Tools::getValue('password'))) {
// @todo clarify error message
$this->errors[] = Tools::displayError('An error occurred while transforming a guest into a registered customer.');
} else {
$this->context->smarty->assign('transformSuccess', true);

View File

@@ -173,7 +173,9 @@ class OrderOpcControllerCore extends ParentOrderController
if (!count($this->errors)) {
$customer = new Customer($this->context->customer->id);
if ($customer->transformToCustomer($this->context->language->id, $passwd)) {
if (!$customer->isGuest()) {
$this->errors[] = Tools::displayError('This account is already registered as a customer.');
} else if ($customer->transformToCustomer($this->context->language->id, $passwd)) {
$this->context->updateCustomer($customer);
} else {
$this->errors[] = Tools::displayError('An error occurred while transforming your account into a registered customer.');

View File

@@ -68,7 +68,7 @@ class HotelAdvancedPayment extends ObjectModel
*/
public function getIdAdvPaymentByIdProduct($id_product)
{
$result = Db::getInstance()->getRow("SELECT * FROM `"._DB_PREFIX_."htl_advance_payment` WHERE `id_product`=".$id_product);
$result = Db::getInstance()->getRow("SELECT * FROM `"._DB_PREFIX_."htl_advance_payment` WHERE `id_product`=".(int) $id_product);
if ($result) {
return $result;

View File

@@ -794,14 +794,14 @@ class HotelRoomTypeFeaturePricing extends ObjectModel
* @param [int] $id_product [id of the product]
* @return [array] [returns all feature prices by product]
*/
public function getFeaturePricesbyIdProduct($id_product)
public function getFeaturePricesbyIdProduct($id_product, $id_cart = 0, $id_guest = 0, $id_room = 0)
{
$idLang = Context::getContext()->language->id;
return Db::getInstance()->executeS(
'SELECT hrfp.*, hrfpl.`feature_price_name` FROM `'._DB_PREFIX_.'htl_room_type_feature_pricing` hrfp
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_feature_pricing_lang` hrfpl
ON(hrfp.`id_feature_price` = hrfpl.`id_feature_price` AND hrfpl.`id_lang` = '.(int)$idLang.')
WHERE `id_product` = '.(int)$id_product
WHERE `id_product` = '.(int)$id_product.' AND `id_cart` = '.(int)$id_cart.' AND `id_guest` = '.(int)$id_guest.' AND `id_room` = '.(int)$id_room
);
}

View File

@@ -493,7 +493,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
$cartrule->date_from = date('Y-m-d H:i:s', $now);
$cartrule->date_to = date('Y-m-d H:i:s', $now + (3600 * 24 * 365.25)); /* 1 year */
$cartrule->active = 1;
$cartrule->highlight = 1;
$cartrule->reduction_amount = $totalRefundedAmount;
$cartrule->reduction_tax = true;
$cartrule->minimum_amount_currency = $objOrder->id_currency;

View File

@@ -1,5 +1,5 @@
<div class="copyRightWrapper">
<p class="copyRight">
&copy; {$WK_HTL_ESTABLISHMENT_YEAR}-{'Y'|date}&nbsp;<a href="{$base_dir}">&nbsp;{$WK_HTL_CHAIN_NAME}</a>.&nbsp;{l s=' All rights reserved.' mod='hotelreservationsystem'}
&copy;{if isset($WK_HTL_ESTABLISHMENT_YEAR) && $WK_HTL_ESTABLISHMENT_YEAR} {$WK_HTL_ESTABLISHMENT_YEAR}-{'Y'|date}&nbsp;{/if}<a href="{$base_dir}">&nbsp;{$WK_HTL_CHAIN_NAME}</a>.&nbsp;{l s=' All rights reserved.' mod='hotelreservationsystem'}
</p>
</div>

View File

@@ -159,11 +159,13 @@ class WkRoomSearchHelper
$searchedData['location'] = $objLocationCategory->name;
} else {
$locationCategoryId = $objCategory->id_parent;
$searchedData['location'] = $searchedData['htl_dtl']['city'];
if (isset($searchedData['htl_dtl']['state_name'])) {
$searchedData['location'] .= ', '.$searchedData['htl_dtl']['state_name'];
if ($searchedData['htl_dtl']) {
$searchedData['location'] = $searchedData['htl_dtl']['city'];
if (isset($searchedData['htl_dtl']['state_name'])) {
$searchedData['location'] .= ', '.$searchedData['htl_dtl']['state_name'];
}
$searchedData['location'] .= ', '.$searchedData['htl_dtl']['country_name'];
}
$searchedData['location'] .= ', '.$searchedData['htl_dtl']['country_name'];
}
$searchedData['location_category_id'] = $locationCategoryId;

View File

@@ -53,7 +53,7 @@
{/if}
{if $discountDetail.reduction_amount > 0}
{if $discountDetail.reduction_percent > 0} + {/if}
{convertPrice price=$discountDetail.reduction_amount} ({if $discountDetail.reduction_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if})
{displayPrice price=$discountDetail.reduction_amount currency=$discountDetail.reduction_currency} ({if $discountDetail.reduction_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if})
{/if}
{if $discountDetail.free_shipping}
{if $discountDetail.reduction_percent > 0 || $discountDetail.reduction_amount > 0} + {/if}
@@ -73,7 +73,7 @@
{if $discountDetail.minimal == 0}
{l s='None'}
{else}
{convertPrice price=$discountDetail.minimal} ({if $discountDetail.minimum_amount_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if})
{displayPrice price=$discountDetail.minimal currency=$discountDetail.reduction_currency} ({if $discountDetail.minimum_amount_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if})
{/if}
</td>
<td class="discount_cumulative">