Merge branch 'develop' into gli-3104
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
@font-face
|
||||
font-family: 'FontAwesomePlaceholder'
|
||||
src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}')
|
||||
src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg')
|
||||
font-weight: normal
|
||||
font-style: normal
|
||||
unicode-range: U+f000-f2ff
|
||||
|
||||
@mixin background-image-with-ms($image)
|
||||
@include background-image($image) // Compass default version, for everything but IE 10.
|
||||
background-image: -ms-#{$image} // Vendor prefixes for IE 10.
|
||||
@@ -29,6 +37,16 @@
|
||||
.form-control
|
||||
height: inherit !important
|
||||
padding: 10px 8px !important
|
||||
&::-webkit-input-placeholder
|
||||
font-family: 'FontAwesomePlaceholder', $font-family-sans-serif
|
||||
&:-moz-placeholder
|
||||
font-family: 'FontAwesomePlaceholder', $font-family-sans-serif
|
||||
&::-moz-placeholder
|
||||
font-family: 'FontAwesomePlaceholder', $font-family-sans-serif
|
||||
&:-ms-input-placeholder
|
||||
font-family: 'FontAwesomePlaceholder', $font-family-sans-serif
|
||||
&::placeholder
|
||||
font-family: 'FontAwesomePlaceholder', $font-family-sans-serif
|
||||
|
||||
@media (max-width: $screen-phone)
|
||||
width: 90%
|
||||
|
||||
@@ -108,13 +108,6 @@
|
||||
{$cartCurrency->sign}
|
||||
</span>
|
||||
<input class="service_cart_price_input" id="service_cart_price_{$selectedRoomServiceProduct['id']}_{$product['id_product']}" type="text" value="{$product.price_tax_exc}" name="service_price[{$product['id_product']|escape:'html':'UTF-8'}]"{if isset($can_edit) && !$can_edit} readonly{/if}/>
|
||||
{if Product::getServicePriceBillableDays(
|
||||
$product['price_calculation_method'],
|
||||
$selectedRoomServiceProduct['date_from'],
|
||||
$selectedRoomServiceProduct['date_to']
|
||||
) > 1}
|
||||
<span class="input-group-addon">{l s='/ night'}</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
@@ -100,13 +100,6 @@
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{$currencySign}</span>
|
||||
<input type="text" class="form-control unit_price" value="{Tools::ps_round($service['unit_price_tax_excl'], 2)}" data-id-product="{$service['id_product']}" name="service_price[{$service['id_service_product_order_detail']}]">
|
||||
{if Product::getServicePriceBillableDays(
|
||||
$service.price_calculation_method,
|
||||
$additionalServices['date_from'],
|
||||
$additionalServices['date_to']
|
||||
) > 1}
|
||||
<span class="input-group-addon">{l s='/ night'}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
<td>{displayPrice price=$service['total_price_tax_excl']|escape:'html':'UTF-8' currency=$orderCurrency}</td>
|
||||
@@ -188,13 +181,6 @@
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{$currencySign}</span>
|
||||
<input type="text" class="form-control unit_price" name="service_price[{$product['id_product']|escape:'html':'UTF-8'}]" value="{$product['price_tax_exc']}" data-id-product="{$product.id_product}">
|
||||
{if Product::getServicePriceBillableDays(
|
||||
$product['price_calculation_method'],
|
||||
$additionalServices['date_from'],
|
||||
$additionalServices['date_to']
|
||||
) > 1}
|
||||
<span class="input-group-addon">{l s='/ night'}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -368,13 +354,6 @@
|
||||
</td>
|
||||
<td>
|
||||
{displayPrice price=$service['unit_price_tax_excl'] currency=$orderCurrency}
|
||||
{if Product::getServicePriceBillableDays(
|
||||
$service['price_calculation_method'],
|
||||
$additionalServices['date_from'],
|
||||
$additionalServices['date_to']
|
||||
) > 1}
|
||||
{l s='/ night'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{displayPrice price=$service['total_price_tax_excl'] currency=$orderCurrency}
|
||||
|
||||
@@ -1895,6 +1895,11 @@ class CartCore extends ObjectModel
|
||||
(int)$product['price_addition_type']
|
||||
)) {
|
||||
foreach ($servicesWithRoom as $service) {
|
||||
|
||||
if (isset($product['id_hotel']) && $service['id_room_type_hotel'] != $product['id_hotel']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!empty($service['id_hotel_cart_booking']) && empty($service['id_hotel'])) {
|
||||
if ($with_taxes) {
|
||||
$servicePrice = $service['total_price_tax_incl'];
|
||||
|
||||
@@ -689,7 +689,11 @@ class LanguageCore extends ObjectModel
|
||||
$key = 'Language::getIdByIso_'.$iso_code;
|
||||
if ($no_cache || !Cache::isStored($key)) {
|
||||
$id_lang = Db::getInstance()->getValue('SELECT `id_lang` FROM `'._DB_PREFIX_.'lang` WHERE `iso_code` = \''.pSQL(strtolower($iso_code)).'\'');
|
||||
|
||||
|
||||
if (empty($id_lang)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Cache::store($key, $id_lang);
|
||||
return $id_lang;
|
||||
}
|
||||
@@ -796,7 +800,7 @@ class LanguageCore extends ObjectModel
|
||||
|
||||
public static function checkAndAddLanguage($iso_code, $lang_pack = false, $only_add = false, $params_lang = null)
|
||||
{
|
||||
if (Language::getIdByIso($iso_code)) {
|
||||
if (Language::getIdByIso($iso_code, true)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -6868,8 +6868,8 @@ class ProductCore extends ObjectModel
|
||||
}
|
||||
|
||||
if ($includeTourismTax && ($idTourismTaxRulesGroup = Product::getIdTourismTaxRulesGroupByIdProduct($idProduct))) {
|
||||
$priceCalcNumDays = $isPerDay ? HotelHelper::getNumberOfDays($dateFrom, $dateTo) : 1;
|
||||
$unitPriceExcl = ($useTax ? Product::getServiceProductPrice($idProduct, $idProductOption, $idHotel, $idProductRoomType, false, 1, $dateFrom, $dateTo, $idCart, $idAddress, $useReduc, $idGroup, $idCartBooking) : $price / (int) $quantity) / $priceCalcNumDays;
|
||||
|
||||
$unitPriceExcl = ($useTax ? Product::getServiceProductPrice($idProduct, $idProductOption, $idHotel, $idProductRoomType, false, 1, $dateFrom, $dateTo, $idCart, $idAddress, $useReduc, $idGroup, $idCartBooking) : $price / (int) $quantity) / max(1, $numdays);
|
||||
|
||||
$fallbackAddress = new Address(Cart::getIdAddressForTaxCalculation($idProduct));
|
||||
if ($numAdults === null) {
|
||||
|
||||
@@ -1885,6 +1885,8 @@ class ToolsCore
|
||||
|
||||
public static function math_round($value, $places, $mode = PS_ROUND_HALF_UP)
|
||||
{
|
||||
$value = (float) $value;
|
||||
|
||||
//If PHP_ROUND_HALF_UP exist (PHP 5.3) use it and pass correct mode value (PrestaShop define - 1)
|
||||
if (defined('PHP_ROUND_HALF_UP')) {
|
||||
return round($value, $places, $mode - 1);
|
||||
|
||||
@@ -592,7 +592,7 @@ class OrderDetailCore extends ObjectModel
|
||||
{
|
||||
$this->setContext((int)$this->id_shop);
|
||||
$address = new Address((int)$order->id_address_tax);
|
||||
$tax_manager = TaxManagerFactory::getManager($address, (int)Product::getIdTaxRulesGroupByIdProduct((int)$this->product_id, $this->context));
|
||||
$tax_manager = TaxManagerFactory::getManager($address, (int)$this->id_tax_rules_group);
|
||||
$this->tax_calculator = $tax_manager->getTaxCalculator();
|
||||
|
||||
$result = $this->saveTaxCalculator($order, true);
|
||||
|
||||
@@ -1217,6 +1217,14 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$objCustomerGuestDetail->email = $objCustomer->email;
|
||||
$objCustomerGuestDetail->save();
|
||||
}
|
||||
|
||||
if ($threads = CustomerThread::getCustomerMessages($objCustomer->id)) {
|
||||
foreach ($threads as $thread) {
|
||||
$objThread = new CustomerThread($thread['id_customer_thread']);
|
||||
$objThread->email = $objCustomer->email;
|
||||
$objThread->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token;
|
||||
|
||||
@@ -4066,7 +4066,9 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$this->errors[] = $this->l('Uploaded file size is too large.');
|
||||
} else {
|
||||
$objHotelBookingDocument->setFileType();
|
||||
if (!$objHotelBookingDocument->file_type) {
|
||||
if ($objHotelBookingDocument->isUnsafePdf) {
|
||||
$this->errors[] = $this->l('This PDF file is invalid or contains unsafe content and cannot be uploaded.');
|
||||
} elseif (!$objHotelBookingDocument->file_type) {
|
||||
$this->errors[] = $this->l('Please upload an image or a PDF file only. Allowed image formats: .gif, .jpg, .jpeg and .png');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -937,6 +937,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
&& Product::duplicateCustomizationFields($id_product_old, $product->id)
|
||||
&& Product::duplicateTags($id_product_old, $product->id)
|
||||
&& Product::duplicateDownload($id_product_old, $product->id)
|
||||
&& HotelAdvancedPayment::duplicateAdvancePayment($id_product_old, $product->id)
|
||||
) {
|
||||
$obj_hotel_room_type = new HotelRoomType();
|
||||
$room_type_info = $obj_hotel_room_type->getRoomTypeInfoByIdProduct($id_product_old);
|
||||
@@ -1249,6 +1250,10 @@ class AdminProductsControllerCore extends AdminController
|
||||
|
||||
if ($payment_type == 1) {
|
||||
$adv_pay_value = Tools::getValue('adv_pay_percent');
|
||||
if ($adv_pay_value > 100) {
|
||||
$this->errors[] = Tools::displayError('Advance payment percentage cannot be more than 100.');
|
||||
return false;
|
||||
}
|
||||
} elseif ($payment_type == 2) {
|
||||
$adv_pay_value = Tools::getValue('adv_pay_amount');
|
||||
}
|
||||
|
||||
@@ -781,7 +781,19 @@ class CartControllerCore extends FrontController
|
||||
);
|
||||
$currentQty = $qty * $numDays;
|
||||
$finalQty = (int)$cartTotalQty + $currentQty;
|
||||
if ($objProduct->max_quantity && $finalQty > $objProduct->max_quantity) {
|
||||
// max quantity limit applies per room, not on the whole cart
|
||||
$serviceQtyInRoom = (int) $qty;
|
||||
if ($roomServices = (new ServiceProductCartDetail())->getServiceProductsInCart(
|
||||
(int) $this->context->cart->id,
|
||||
[],
|
||||
null,
|
||||
(int) $idCartBooking,
|
||||
null,
|
||||
(int) $idServiceProduct
|
||||
)) {
|
||||
$serviceQtyInRoom += (int) array_sum(array_column($roomServices, 'quantity'));
|
||||
}
|
||||
if ($objProduct->max_quantity && $serviceQtyInRoom > $objProduct->max_quantity) {
|
||||
$this->errors[] = Tools::displayError(sprintf('cannot add more than %d quantity.', $objProduct->max_quantity));
|
||||
} else if (!Product::isAvailableWhenOutOfStock($objProduct->out_of_stock) && !$objProduct->checkQty($finalQty)) {
|
||||
$this->errors[] = Tools::displayError('There isn\'t enough product in stock.');
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset(Context::getContext()->controller)) {
|
||||
$controller = Context::getContext()->controller;
|
||||
} else {
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset(Context::getContext()->controller)) {
|
||||
$controller = Context::getContext()->controller;
|
||||
} else {
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 613 B |
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB |
4
init.php
4
init.php
@@ -24,6 +24,10 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset(Context::getContext()->controller)) {
|
||||
$controller = Context::getContext()->controller;
|
||||
} else {
|
||||
|
||||
@@ -70,7 +70,9 @@ $('document').ready( function() {
|
||||
});
|
||||
|
||||
$('#proceed-install-anyway').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
if ($(this).attr('href') === '#') {
|
||||
e.preventDefault();
|
||||
}
|
||||
})
|
||||
|
||||
function displayErrors(response, module)
|
||||
|
||||
@@ -97,7 +97,7 @@ function removeTaxes(price)
|
||||
|
||||
function getEcotaxTaxIncluded()
|
||||
{
|
||||
return ps_round(ecotax_tax_excl * (1 + ecotaxTaxRate), 2);
|
||||
return ps_round((isNaN(ecotax_tax_excl) ? 0 : ecotax_tax_excl) * (1 + ecotaxTaxRate), 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -187,7 +187,9 @@ function calcPriceTI()
|
||||
|
||||
function calcPriceTE()
|
||||
{
|
||||
ecotax_tax_excl = $('#ecotax').val() / (1 + ecotaxTaxRate);
|
||||
if ($('#ecotax').length) {
|
||||
ecotax_tax_excl = $('#ecotax').val() / (1 + ecotaxTaxRate);
|
||||
}
|
||||
var priceTI = parseFloat($('#priceTI').val().replace(/,/g, '.'));
|
||||
var newPrice = removeTaxes(ps_round(priceTI - getEcotaxTaxIncluded(), priceDisplayPrecision));
|
||||
var tourismTaxIncluded = getTourismTaxIncluded(newPrice);
|
||||
|
||||
@@ -79,6 +79,31 @@ class HotelAdvancedPayment extends ObjectModel
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Duplicate the advance payment configuration of a room type for its duplicate
|
||||
*
|
||||
* @param int $id_product_old Id of the room type (product) being duplicated
|
||||
* @param int $id_product_new Id of the newly duplicated room type (product)
|
||||
* @return bool
|
||||
*/
|
||||
public static function duplicateAdvancePayment($id_product_old, $id_product_new)
|
||||
{
|
||||
$row = Db::getInstance()->getRow(
|
||||
'SELECT * FROM `'._DB_PREFIX_.'htl_advance_payment` WHERE `id_product` = '.(int)$id_product_old
|
||||
);
|
||||
|
||||
if (!$row) {
|
||||
return true;
|
||||
}
|
||||
|
||||
unset($row['id']);
|
||||
$row['id_product'] = (int)$id_product_new;
|
||||
$row['date_add'] = date('Y-m-d H:i:s');
|
||||
$row['date_upd'] = date('Y-m-d H:i:s');
|
||||
|
||||
return Db::getInstance()->insert('htl_advance_payment', $row);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the advance payment amount of the room type in the cart
|
||||
* @param [int] $idCart : cart id
|
||||
|
||||
@@ -604,7 +604,7 @@ class HotelBookingDetail extends ObjectModel
|
||||
$sql[] = 'SELECT hri.`id` AS `id_room`, hri.`id_product`, hri.`id_hotel`, hri.`room_num`, hri.`comment` AS `room_comment`, hri.`id_status`, hrdd.`date_from` AS `date_from`, hrdd.`date_to` AS `date_to`
|
||||
FROM `'._DB_PREFIX_.'htl_room_information` AS hri
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_disable_dates` AS hrdd ON (hrdd.`id_room_type` = hri.`id_product` AND hrdd. id_room = hri.`id`)
|
||||
WHERE hri.`id_hotel`='.$idHotel.' AND hri.`id_status` = '. HotelRoomInformation::STATUS_TEMPORARY_INACTIVE .' AND (
|
||||
WHERE hri.`id_hotel`='.(int) $idHotel.' AND hri.`id_status` = '. HotelRoomInformation::STATUS_TEMPORARY_INACTIVE .' AND (
|
||||
(hrdd.`date_from` <= \''.pSQL($dateFrom).'\' AND hrdd.`date_to` > \''.pSQL($dateFrom).'\' AND hrdd.`date_to` <= \''.pSQL($dateTo).'\') OR
|
||||
(hrdd.`date_from` >= \''.pSQL($dateFrom).'\' AND hrdd.`date_to` > \''.pSQL($dateFrom).'\' AND hrdd.`date_to` <= \''.pSQL($dateTo).'\') OR
|
||||
(hrdd.`date_from` >= \''.pSQL($dateFrom).'\' AND hrdd.`date_from` < \''.pSQL($dateTo).'\' AND hrdd.`date_to` >= \''.pSQL($dateTo).'\') OR
|
||||
|
||||
@@ -30,6 +30,9 @@ class HotelBookingDocument extends ObjectModel
|
||||
public $file_name;
|
||||
public $date_add;
|
||||
|
||||
/** @var bool True when the file is a PDF but was rejected for unsafe content. */
|
||||
public $isUnsafePdf = false;
|
||||
|
||||
const FILE_TYPE_IMAGE = 1;
|
||||
const FILE_TYPE_PDF = 2;
|
||||
|
||||
@@ -139,16 +142,28 @@ class HotelBookingDocument extends ObjectModel
|
||||
public function setFileType()
|
||||
{
|
||||
$content = @file_get_contents($this->fileInfo['tmp_name']);
|
||||
$activeContentPattern = '/\/(JavaScript|JS|OpenAction|AA|Launch|SubmitForm|ImportData)\b/i';
|
||||
|
||||
// PDF names can hide keywords with hex escapes (/J#53 is /JS), so decode them before matching.
|
||||
$decodedContent = ($content === false) ? '' : preg_replace_callback('/#([0-9a-f]{2})/i', function ($match) {
|
||||
return chr(hexdec($match[1]));
|
||||
}, $content);
|
||||
|
||||
// A complete PDF ends with startxref <offset> %%EOF; anything else is truncated or corrupt.
|
||||
// Encrypted PDFs cannot be scanned, so /Encrypt is blocked too.
|
||||
// /OpenAction followed by '[' is a plain page destination (zoom/fit).
|
||||
// for every generated PDF. Any other /OpenAction value is an action and stays blocked.
|
||||
$activeContentPattern = '/\/(JavaScript|JS|AA|Launch|SubmitForm|ImportData|GoToR|GoToE|EmbeddedFile|RichMedia|XFA|Encrypt)\b|\/OpenAction\b(?!\s*\[)/i';
|
||||
|
||||
$this->isUnsafePdf = false;
|
||||
$this->imageInfo = @getimagesize($this->fileInfo['tmp_name']);
|
||||
|
||||
if ($this->imageInfo && ImageManager::isRealImage($this->fileInfo['tmp_name'])) {
|
||||
$this->file_type = self::FILE_TYPE_IMAGE;
|
||||
} elseif ($content !== false && substr($content, 0, 5) === '%PDF-' && !preg_match($activeContentPattern, $content)) {
|
||||
} elseif ($content !== false && substr($content, 0, 5) === '%PDF-' && preg_match('/startxref\s+\d+\s+%%EOF\s*$/', substr($content, -1024)) && !preg_match($activeContentPattern, $decodedContent)) {
|
||||
$this->file_type = self::FILE_TYPE_PDF;
|
||||
} else {
|
||||
$this->file_type = 0;
|
||||
$this->isUnsafePdf = ($content !== false && substr($content, 0, 5) === '%PDF-');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -385,17 +385,20 @@ class HotelRoomTypeFeaturePricing extends ObjectModel
|
||||
$numNights = max(1, (int) HotelHelper::getNumberOfDays($date_from, $date_to));
|
||||
$unitPriceTe = (float) $totalPrice['total_price_tax_excl'] / $numNights;
|
||||
$taxCalculator = TaxManagerFactory::getManager($objAddress, $idTourismTaxRulesGroup)->getTaxCalculator();
|
||||
$childAges = !empty($occupancy[0]['child_ages']) ? (array) $occupancy[0]['child_ages'] : array();
|
||||
$totalPrice['total_price_tax_incl'] += $taxCalculator->getTaxesTotalAmount(
|
||||
$unitPriceTe,
|
||||
$date_from,
|
||||
$numNights,
|
||||
$occupancy[0]['adults'],
|
||||
$childAges,
|
||||
$collectionType,
|
||||
1,
|
||||
$id_currency
|
||||
);
|
||||
$roomsTourismTax = 0;
|
||||
foreach ($occupancy as $roomOccupancy) {
|
||||
$roomsTourismTax += $taxCalculator->getTaxesTotalAmount(
|
||||
$unitPriceTe,
|
||||
$date_from,
|
||||
$numNights,
|
||||
isset($roomOccupancy['adults']) ? (int) $roomOccupancy['adults'] : 0,
|
||||
!empty($roomOccupancy['child_ages']) ? (array) $roomOccupancy['child_ages'] : array(),
|
||||
$collectionType,
|
||||
1,
|
||||
$id_currency
|
||||
);
|
||||
}
|
||||
$totalPrice['total_price_tax_incl'] += $roomsTourismTax / count($occupancy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ class ServiceProductCartDetail extends ObjectModel
|
||||
$language = new Language($idLang);
|
||||
}
|
||||
|
||||
$sql = 'SELECT spc.*, p.`selling_preference_type`, hcbd.`date_from`, spc.`id_cart` as service_id_cart, hcbd.`date_to`, p.`price_calculation_method`, hcbd.`id_product` as `id_product_room_type`';
|
||||
$sql = 'SELECT spc.*, p.`selling_preference_type`, hcbd.`date_from`, spc.`id_cart` as service_id_cart, hcbd.`date_to`, p.`price_calculation_method`, hcbd.`id_product` as `id_product_room_type`, hcbd.`id_hotel` as `id_room_type_hotel`';
|
||||
if (!$getTotalPrice) {
|
||||
$sql .= ', hbil.`hotel_name`, p.`auto_add_to_cart`, p.`price_addition_type` ';
|
||||
}
|
||||
|
||||
@@ -134,13 +134,16 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
$date_from = date('Y-m-d');
|
||||
}
|
||||
}
|
||||
if (Tools::getValue('date_to')) {
|
||||
$date_to = Tools::getValue('date_to');
|
||||
} else {
|
||||
if (!Validate::isDate($date_from)) {
|
||||
$date_from = date('Y-m-d');
|
||||
}
|
||||
$date_to = Tools::getValue('date_to');
|
||||
if (!$date_to || !Validate::isDate($date_to)) {
|
||||
$date_to = date('Y-m-d');
|
||||
if (strtotime($date_from) >= strtotime($date_to)) {
|
||||
$date_to = date('Y-m-d', strtotime('+1 day', strtotime($date_to)));
|
||||
}
|
||||
}
|
||||
// Check-out date must always be after check-in date
|
||||
if (strtotime($date_from) >= strtotime($date_to)) {
|
||||
$date_to = date('Y-m-d', strtotime('+1 day', strtotime($date_from)));
|
||||
}
|
||||
|
||||
if (Tools::getValue('id_hotel')) {
|
||||
|
||||
@@ -510,33 +510,23 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
|
||||
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
|
||||
$idOrderDetail = $objHtlBooking->id_order_detail;
|
||||
|
||||
// split the admin's single tax-incl entry using the booking's
|
||||
// own tax ratio; (float) cast since DB decimals come back as
|
||||
// strings like "0.000000", which PHP treats as truthy
|
||||
$refundedAmountTaxExcl = (float) $objHtlBooking->total_price_tax_incl
|
||||
? $refundedAmount * ($objHtlBooking->total_price_tax_excl / $objHtlBooking->total_price_tax_incl)
|
||||
: $refundedAmount;
|
||||
|
||||
// $refundedAmount is already tax-incl. (see the "tax incl."
|
||||
$bookingList[$idRetDetail] = array(
|
||||
'id_htl_booking' => $idHtlBooking,
|
||||
'id_order_detail' => $idOrderDetail,
|
||||
'quantity' => $numDays,
|
||||
'num_days' => $numDays,
|
||||
'unit_price' => $refundedAmountTaxExcl / $numDays,
|
||||
'unit_price' => $refundedAmount / $numDays,
|
||||
);
|
||||
} elseif ($idServiceProductOrder = $objOrderReturnDetail->id_service_product_order_detail) {
|
||||
$objServiceProductOrderDetail = new ServiceProductOrderDetail($idServiceProductOrder);
|
||||
|
||||
// same reasoning as the booking branch above
|
||||
$refundedAmountTaxExcl = (float) $objServiceProductOrderDetail->total_price_tax_incl
|
||||
? $refundedAmount * ($objServiceProductOrderDetail->total_price_tax_excl / $objServiceProductOrderDetail->total_price_tax_incl)
|
||||
: $refundedAmount;
|
||||
|
||||
$bookingList[$idRetDetail] = array(
|
||||
'id_service_product_order_detail' => $idServiceProductOrder,
|
||||
'id_order_detail' => $objServiceProductOrderDetail->id_order_detail,
|
||||
'quantity' => $objServiceProductOrderDetail->quantity,
|
||||
'unit_price' => $refundedAmountTaxExcl / $objServiceProductOrderDetail->quantity,
|
||||
'unit_price' => $refundedAmount / $objServiceProductOrderDetail->quantity,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,7 +444,6 @@ class HotelReservationSystem extends Module
|
||||
$langTables = array(
|
||||
'htl_room_type_feature_pricing',
|
||||
'htl_branch_info',
|
||||
'htl_features',
|
||||
'htl_amenity',
|
||||
'htl_order_refund_rules',
|
||||
'htl_settings_link'
|
||||
|
||||
@@ -106,7 +106,7 @@ class WkHotelRoom extends Module
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
array(array('adults' => 1, 'children' => 0, 'child_ages' => array()))
|
||||
);
|
||||
$htlRoom['feature_price'] = $featurePrice;
|
||||
|
||||
@@ -96,16 +96,7 @@
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
{if ($product.show_price && !isset($restricted_country_mode)) || isset($groups)}
|
||||
<span class="pull-right">{if !$priceDisplay}{convertPrice price=$product.price_tax_incl}{else}{convertPrice price=$product.price_tax_exc}{/if}
|
||||
{if Product::getServicePriceBillableDays(
|
||||
$product.price_calculation_method,
|
||||
$product.date_from|default:$date_from|default:'',
|
||||
$product.date_to|default:$date_to|default:''
|
||||
) > 1}
|
||||
<span class="price-label">{l s='/Night'}</span>
|
||||
{/if}
|
||||
</span>
|
||||
|
||||
<span class="pull-right">{if !$priceDisplay}{convertPrice price=$product.price_tax_incl}{else}{convertPrice price=$product.price_tax_exc}{/if}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -68,13 +68,6 @@
|
||||
<div class="service-product-price">
|
||||
{block name='service_product_price'}
|
||||
{if !$priceDisplay}{convertPrice price=$service_product.price_tax_incl}{else}{convertPrice price=$service_product.price_tax_exc}{/if}
|
||||
{if Product::getServicePriceBillableDays(
|
||||
$service_product.price_calculation_method,
|
||||
$service_product.date_from|default:$date_from|default:'',
|
||||
$service_product.date_to|default:$date_to|default:''
|
||||
) > 1}
|
||||
<span class="price-label">{l s='/Night'}</span>
|
||||
{/if}
|
||||
{/block}
|
||||
{if $service_product.allow_multiple_quantity && $service_product.available_for_order && $service_product.max_quantity > 0}
|
||||
<div class="service-max-quantity-info">
|
||||
|
||||
Reference in New Issue
Block a user