Updated: Price Rounding process improved in entire QloApps system and Issues in pricing in tables and order edit and reallocation process fixed
This commit is contained in:
@@ -124,7 +124,7 @@
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="#" class="room_reallocate_swap" id="reallocate_room_{$data['id']}" data-room_type_name="{$data['room_type_name']}" data-toggle="modal" data-target="#mySwappigModal" data-id_htl_booking="{$data['id']}" data-id_order="{$data['id_order']}" data-room_num='{$data.room_num}' data-id_room_type='{$data.id_product}' data-cust_name='{$data.alloted_cust_name}' data-cust_email='{$data.alloted_cust_email}' data-avail_rm_swap='{$data.avail_rooms_to_swap|@json_encode}' data-avail_realloc_room_types='{$data.avail_room_types_to_realloc|@json_encode}' data-allotment_type='{$data['booking_type']}' data-allotment_type_label='{if $data['booking_type'] == $ALLOTMENT_MANUAL}{l s='Manual'}{else}{l s='Auto'}{/if}' data-comment='{$data.comment}'>
|
||||
<a href="#" class="room_reallocate_swap" id="reallocate_room_{$data['id']}" data-room_type_name="{$data['room_type_name']}" data-toggle="modal" data-target="#mySwappigModal" data-id_htl_booking="{$data['id']}" data-id_order="{$data['id_order']}" data-room_num='{$data.room_num}' data-id_room_type='{$data.id_product}' data-cust_name='{$data.alloted_cust_name}' data-cust_email='{$data.alloted_cust_email}' data-avail_rm_swap='{$data.avail_rooms_to_swap|@json_encode}' data-avail_realloc_room_types='{$data.avail_room_types_to_realloc|@json_encode}' data-allotment_type='{$data.booking_type}' data-allotment_type_label='{if $data.booking_type == $ALLOTMENT_MANUAL}{l s='Manual'}{else}{l s='Auto'}{/if}' data-comment='{$data.comment}'>
|
||||
<i class="icon-refresh"></i>
|
||||
{l s='Reallocate/Swap Room'}
|
||||
</a>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{$currencySign}</span>
|
||||
<input type="text" class="form-control unit_price" value="{Tools::ps_round($demand['unit_price_tax_excl'], 2)}">
|
||||
<input type="text" class="form-control unit_price" value="{$demand['unit_price_tax_excl']}">
|
||||
{if $demand['price_calc_method'] == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY}
|
||||
<span class="input-group-addon">{l s='/ night'}</span>
|
||||
{/if}
|
||||
@@ -115,7 +115,7 @@
|
||||
{else}
|
||||
{assign var=demand_price value=$demand['price_tax_excl']}
|
||||
{/if}
|
||||
<input type="text" class="form-control unit_price" value="{Tools::ps_round($demand_price, 2)}" data-id-product="{$product['id_product']}">
|
||||
<input type="text" class="form-control unit_price" value="{$demand_price}" data-id-product="{$product['id_product']}">
|
||||
{if $demand['price_calc_method'] == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY}
|
||||
<span class="input-group-addon">{l s='/ night'}</span>
|
||||
{/if}
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<td class="demand_price_{$demand['id_global_demand']}">
|
||||
<div class="input-group price_input" {if !isset($selectedDemands[$demand['id_global_demand']])}style="display:none"{/if}>
|
||||
<span class="input-group-addon">{$defaultcurrencySign|escape:'html':'UTF-8'}</span>
|
||||
<input type="text" name="option_price_{$option['id']|escape:'html':'UTF-8'}" value="{if isset($selectedDemands[$demand['id_global_demand']]['adv_option'][$option['id']]['price'])}{Tools::ps_round($selectedDemands[$demand['id_global_demand']]['adv_option'][$option['id']]['price'], 2)|escape:'html':'UTF-8'}{else}{Tools::ps_round($option['price'], 2)|escape:'html':'UTF-8'}{/if}"/>
|
||||
<input type="text" name="option_price_{$option['id']|escape:'html':'UTF-8'}" value="{if isset($selectedDemands[$demand['id_global_demand']]['adv_option'][$option['id']]['price'])}{$selectedDemands[$demand['id_global_demand']]['adv_option'][$option['id']]['price']|escape:'html':'UTF-8'}{else}{$option['price']|escape:'html':'UTF-8'}{/if}"/>
|
||||
</div>
|
||||
<div class="price_display" {if isset($selectedDemands[$demand['id_global_demand']])}style="display:none"{/if}>
|
||||
{displayPrice price={$option['price']|escape:'html':'UTF-8'} currency=$idDefaultcurrency}
|
||||
@@ -112,7 +112,7 @@
|
||||
<div class="input-group price_input" {if !isset($selectedDemands[$demand['id_global_demand']])}style="display:none"{/if}>
|
||||
<span class="input-group-addon">{$defaultcurrencySign|escape:'html':'UTF-8'}</span>
|
||||
<input type="text" name="demand_price_{$demand['id_global_demand']|escape:'html':'UTF-8'}"
|
||||
value="{if isset($selectedDemands[$demand['id_global_demand']]['price'])}{Tools::ps_round($selectedDemands[$demand['id_global_demand']]['price'], 2)|escape:'html':'UTF-8'}{elseif isset($demand['price'])}{Tools::ps_round($demand['price'], 2)|escape:'html':'UTF-8'}{/if}"/>
|
||||
value="{if isset($selectedDemands[$demand['id_global_demand']]['price'])}{$selectedDemands[$demand['id_global_demand']]['price']|escape:'html':'UTF-8'}{elseif isset($demand['price'])}{$demand['price']|escape:'html':'UTF-8'}{/if}"/>
|
||||
</div>
|
||||
<div class="price_display" {if isset($selectedDemands[$demand['id_global_demand']])}style="display:none"{/if}>
|
||||
{displayPrice price={$demand['price']|escape:'html':'UTF-8'} currency=$idDefaultcurrency}
|
||||
|
||||
190
classes/Cart.php
190
classes/Cart.php
@@ -721,29 +721,6 @@ class CartCore extends ObjectModel
|
||||
$cart_shop_context
|
||||
);
|
||||
|
||||
/*Before Changes by webkul*/
|
||||
// switch (Configuration::get('PS_ROUND_TYPE'))
|
||||
// {
|
||||
// case Order::ROUND_TOTAL:
|
||||
// $row['total'] = $row['price_with_reduction_without_tax'] * (int)$row['cart_quantity'];
|
||||
// $row['total_wt'] = $row['price_with_reduction'] * (int)$row['cart_quantity'];
|
||||
// break;
|
||||
// case Order::ROUND_LINE:
|
||||
// $row['total'] = Tools::ps_round($row['price_with_reduction_without_tax'] * (int)$row['cart_quantity'], _PS_PRICE_COMPUTE_PRECISION_);
|
||||
// $row['total_wt'] = Tools::ps_round($row['price_with_reduction'] * (int)$row['cart_quantity'], _PS_PRICE_COMPUTE_PRECISION_);
|
||||
// break;
|
||||
|
||||
// case Order::ROUND_ITEM:
|
||||
// default:
|
||||
// $row['total'] = Tools::ps_round($row['price_with_reduction_without_tax'], _PS_PRICE_COMPUTE_PRECISION_) * (int)$row['cart_quantity'];
|
||||
// $row['total_wt'] = Tools::ps_round($row['price_with_reduction'], _PS_PRICE_COMPUTE_PRECISION_) * (int)$row['cart_quantity'];
|
||||
// break;
|
||||
// }
|
||||
//$row['price_wt'] = $row['price_with_reduction'];
|
||||
//
|
||||
//
|
||||
/*By Webkul */
|
||||
|
||||
if ($row['booking_product']) {
|
||||
if (Module::isInstalled('hotelreservationsystem') && Module::isEnabled('hotelreservationsystem')) {
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
@@ -757,81 +734,57 @@ class CartCore extends ObjectModel
|
||||
$priceDisplay = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
||||
foreach ($roomTypesByIdProduct as $key => $cartRoomInfo) {
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$cartRoomInfo['id_product'],
|
||||
$cartRoomInfo['date_from'],
|
||||
$cartRoomInfo['date_to'],
|
||||
0,
|
||||
Group::getCurrent()->id,
|
||||
$cartRoomInfo['id_cart'],
|
||||
$cartRoomInfo['id_guest'],
|
||||
$cartRoomInfo['id_room'],
|
||||
0
|
||||
);
|
||||
$cartRoomInfo['id_product'],
|
||||
$cartRoomInfo['date_from'],
|
||||
$cartRoomInfo['date_to'],
|
||||
0,
|
||||
Group::getCurrent()->id,
|
||||
$cartRoomInfo['id_cart'],
|
||||
$cartRoomInfo['id_guest'],
|
||||
$cartRoomInfo['id_room'],
|
||||
0
|
||||
);
|
||||
$totalPriceByProductTaxIncl += $roomTotalPrice['total_price_tax_incl'];
|
||||
$totalPriceByProductTaxExcl += $roomTotalPrice['total_price_tax_excl'];
|
||||
}
|
||||
|
||||
switch (Configuration::get('PS_ROUND_TYPE')) {
|
||||
case Order::ROUND_TOTAL:
|
||||
$row['total'] = $totalPriceByProductTaxExcl;
|
||||
$row['total_wt'] = $totalPriceByProductTaxIncl;
|
||||
break;
|
||||
case Order::ROUND_LINE:
|
||||
$row['total'] = Tools::ps_round($totalPriceByProductTaxExcl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$row['total_wt'] = Tools::ps_round($totalPriceByProductTaxIncl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
break;
|
||||
|
||||
case Order::ROUND_ITEM:
|
||||
default:
|
||||
$row['total'] = Tools::ps_round($totalPriceByProductTaxExcl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$row['total_wt'] = Tools::ps_round($totalPriceByProductTaxIncl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
break;
|
||||
}
|
||||
// Rounding as per configurations
|
||||
$row['total'] = Tools::processPriceRounding($totalPriceByProductTaxExcl);
|
||||
$row['total_wt'] = Tools::processPriceRounding($totalPriceByProductTaxIncl);
|
||||
}
|
||||
} else if (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $row['service_product_type']) {
|
||||
$row['total'] = 0;
|
||||
$row['total_wt'] = 0;
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$totalPriceByProductTaxIncl = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart($this->id, (int)$row['id_product'], 0, 0, 0, 0, 0, true, null);
|
||||
$totalPriceByProductTaxExcl = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart($this->id, (int)$row['id_product'], 0, 0, 0, 0, 0, false, null);
|
||||
|
||||
|
||||
switch (Configuration::get('PS_ROUND_TYPE')) {
|
||||
case Order::ROUND_TOTAL:
|
||||
$row['total'] = $totalPriceByProductTaxExcl;
|
||||
$row['total_wt'] = $totalPriceByProductTaxIncl;
|
||||
break;
|
||||
case Order::ROUND_LINE:
|
||||
$row['total'] = Tools::ps_round($totalPriceByProductTaxExcl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$row['total_wt'] = Tools::ps_round($totalPriceByProductTaxIncl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
break;
|
||||
|
||||
case Order::ROUND_ITEM:
|
||||
default:
|
||||
$row['total'] = Tools::ps_round($totalPriceByProductTaxExcl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$row['total_wt'] = Tools::ps_round($totalPriceByProductTaxIncl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
break;
|
||||
if ($servicesWithRoom = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
$this->id,
|
||||
(int)$row['id_product'],
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
$row['auto_add_to_cart'],
|
||||
null,
|
||||
null
|
||||
)) {
|
||||
foreach ($servicesWithRoom as $service) {
|
||||
// Rounding as per configurations
|
||||
$row['total'] += Tools::processPriceRounding($service['unit_price_tax_excl'], $service['quantity']);
|
||||
$row['total_wt'] += Tools::processPriceRounding($service['unit_price_tax_incl'], $service['quantity']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$objHotelServiceProductCartDetail = new HotelServiceProductCartDetail();
|
||||
$unitPriceByProductTaxIncl = $objHotelServiceProductCartDetail->getHotelProductUnitPrice($this->id, (int)$row['id_product'], 0, true);
|
||||
$unitPriceByProductTaxExcl = $objHotelServiceProductCartDetail->getHotelProductUnitPrice($this->id, (int)$row['id_product'], 0, false);
|
||||
|
||||
switch (Configuration::get('PS_ROUND_TYPE'))
|
||||
{
|
||||
case Order::ROUND_TOTAL:
|
||||
$row['total'] = $unitPriceByProductTaxExcl * (int)$row['cart_quantity'];
|
||||
$row['total_wt'] = $unitPriceByProductTaxIncl * (int)$row['cart_quantity'];
|
||||
break;
|
||||
case Order::ROUND_LINE:
|
||||
$row['total'] = Tools::ps_round($unitPriceByProductTaxExcl * (int)$row['cart_quantity'], _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$row['total_wt'] = Tools::ps_round($unitPriceByProductTaxIncl * (int)$row['cart_quantity'], _PS_PRICE_COMPUTE_PRECISION_);
|
||||
break;
|
||||
// Rounding as per configurations
|
||||
$row['total'] += Tools::processPriceRounding($unitPriceByProductTaxExcl, $row['cart_quantity']);
|
||||
$row['total_wt'] += Tools::processPriceRounding($unitPriceByProductTaxIncl, $row['cart_quantity']);
|
||||
|
||||
case Order::ROUND_ITEM:
|
||||
default:
|
||||
$row['total'] = Tools::ps_round($unitPriceByProductTaxExcl, _PS_PRICE_COMPUTE_PRECISION_) * (int)$row['cart_quantity'];
|
||||
$row['total_wt'] = Tools::ps_round($unitPriceByProductTaxIncl, _PS_PRICE_COMPUTE_PRECISION_) * (int)$row['cart_quantity'];
|
||||
break;
|
||||
}
|
||||
$row['price_wt'] = $row['price_with_reduction'];
|
||||
}
|
||||
|
||||
@@ -1794,19 +1747,36 @@ class CartCore extends ObjectModel
|
||||
$objHotelServiceProductCartDetail = new HotelServiceProductCartDetail();
|
||||
$price = $objHotelServiceProductCartDetail->getHotelProductUnitPrice($this->id, (int)$product['id_product'], 0, $with_taxes);
|
||||
} else if (!$product['booking_product'] && Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product['service_product_type']) {
|
||||
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$totalPriceByProduct = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart(
|
||||
if ($servicesWithRoom = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
$this->id,
|
||||
(int)$product['id_product'],
|
||||
isset($product['id_hotel']) ? $product['id_hotel'] : 0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
$with_taxes,
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
$product['auto_add_to_cart'],
|
||||
null,
|
||||
null
|
||||
);
|
||||
)) {
|
||||
foreach ($servicesWithRoom as $service) {
|
||||
if ($with_taxes) {
|
||||
$servicePrice = $service['total_price_tax_incl'];
|
||||
} else {
|
||||
$servicePrice = $service['total_price_tax_excl'];
|
||||
}
|
||||
|
||||
// Rounding as per configurations
|
||||
if ($ps_round_type == Order::ROUND_TOTAL) {
|
||||
$products_total[$id_tax_rules_group.'_'.$id_address] += $servicePrice;
|
||||
} else {
|
||||
$products_total[$id_tax_rules_group] += $servicePrice;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ($roomTypesByIdProduct = $objCartBookingData->getCartInfoIdCartIdProduct($this->id, $product['id_product'])) {
|
||||
// by webkul to calculate rates of the product from hotelreservation syatem tables with feature prices....
|
||||
$totalPriceByProduct = 0;
|
||||
@@ -1825,9 +1795,9 @@ class CartCore extends ObjectModel
|
||||
0
|
||||
);
|
||||
if ($with_taxes) {
|
||||
$totalPriceByProduct += $roomTotalPrice['total_price_tax_incl'];
|
||||
$totalPriceByProduct = $roomTotalPrice['total_price_tax_incl'];
|
||||
} else {
|
||||
$totalPriceByProduct += $roomTotalPrice['total_price_tax_excl'];
|
||||
$totalPriceByProduct = $roomTotalPrice['total_price_tax_excl'];
|
||||
}
|
||||
|
||||
// If customer has selected advance payment of the cart
|
||||
@@ -1846,40 +1816,16 @@ class CartCore extends ObjectModel
|
||||
$totalPriceByProduct = $advProductPrice;
|
||||
}
|
||||
}
|
||||
|
||||
// Rounding as per configurations
|
||||
if ($ps_round_type == Order::ROUND_TOTAL) {
|
||||
$products_total[$id_tax_rules_group.'_'.$id_address] += Tools::processPriceRounding($totalPriceByProduct);
|
||||
} else {
|
||||
$products_total[$id_tax_rules_group] += Tools::processPriceRounding($totalPriceByProduct);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch ($ps_round_type) {
|
||||
case Order::ROUND_TOTAL:
|
||||
if ($product['booking_product'] || (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product['service_product_type'])) {
|
||||
$products_total[$id_tax_rules_group.'_'.$id_address] += $totalPriceByProduct;
|
||||
} else {
|
||||
$products_total[$id_tax_rules_group.'_'.$id_address] += $price * (int)$product['cart_quantity'];
|
||||
}
|
||||
break;
|
||||
|
||||
case Order::ROUND_LINE:
|
||||
if ($product['booking_product'] || (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product['service_product_type'])) {
|
||||
$product_price = $totalPriceByProduct;
|
||||
} else {
|
||||
$product_price = $price * $product['cart_quantity'];
|
||||
}
|
||||
$products_total[$id_tax_rules_group] += Tools::ps_round($product_price, $compute_precision);
|
||||
break;
|
||||
|
||||
case Order::ROUND_ITEM:
|
||||
default:
|
||||
if ($product['booking_product'] || (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product['service_product_type'])) {
|
||||
$product_price = $totalPriceByProduct;
|
||||
$products_total[$id_tax_rules_group] += Tools::ps_round($product_price, $compute_precision);
|
||||
} else {
|
||||
$product_price = /*$with_taxes ? $tax_calculator->addTaxes($price) : */$price;
|
||||
$products_total[$id_tax_rules_group] += Tools::ps_round($product_price, $compute_precision) * (int)$product['cart_quantity'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// price of extra demands on room type in the cart
|
||||
$totalDemandsPrice += $objCartBookingData->getCartExtraDemands($this->id, $product['id_product'], 0, 0, 0, 1, 0, (int)$with_taxes);
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ abstract class PaymentModuleCore extends Module
|
||||
$price_wt = Product::getPriceStatic((int)$product['id_product'], true, ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), 2, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart);
|
||||
|
||||
|
||||
$product_price = Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt;
|
||||
$product_price = Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, _PS_PRICE_COMPUTE_PRECISION_) : $price_wt;
|
||||
|
||||
$product_var_tpl = array(
|
||||
'reference' => $product['reference'],
|
||||
@@ -819,10 +819,11 @@ abstract class PaymentModuleCore extends Module
|
||||
$objCartBookingData->id_room,
|
||||
0
|
||||
);
|
||||
|
||||
$objBookingDetail->date_from = $objCartBookingData->date_from;
|
||||
$objBookingDetail->date_to = $objCartBookingData->date_to;
|
||||
$objBookingDetail->total_price_tax_excl = Tools::ps_round($total_price['total_price_tax_excl'], 6);
|
||||
$objBookingDetail->total_price_tax_incl = Tools::ps_round($total_price['total_price_tax_incl'], 6);
|
||||
$objBookingDetail->total_price_tax_excl = $total_price['total_price_tax_excl'];
|
||||
$objBookingDetail->total_price_tax_incl = $total_price['total_price_tax_incl'];
|
||||
$objBookingDetail->adults = $objCartBookingData->adults;
|
||||
$objBookingDetail->children = $objCartBookingData->children;
|
||||
$objBookingDetail->child_ages = $objCartBookingData->child_ages;
|
||||
@@ -850,7 +851,7 @@ abstract class PaymentModuleCore extends Module
|
||||
}
|
||||
|
||||
/*for saving details of the advance payment product wise*/
|
||||
$objBookingDetail->total_paid_amount = Tools::ps_round($total_price['total_price_tax_incl'], 5);
|
||||
$objBookingDetail->total_paid_amount = $total_price['total_price_tax_incl'];
|
||||
if ($this->context->cart->is_advance_payment) {
|
||||
$prod_adv_payment = $objAdvancedPayment->getIdAdvPaymentByIdProduct($idProduct);
|
||||
if (!$prod_adv_payment
|
||||
@@ -898,18 +899,17 @@ abstract class PaymentModuleCore extends Module
|
||||
$idOption,
|
||||
1
|
||||
);
|
||||
$qty = 1;
|
||||
|
||||
$numDays = 1;
|
||||
if ($objGlobalDemand->price_calc_method == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY) {
|
||||
$numDays = $objBookingDetail->getNumberOfDays(
|
||||
$objBookingDetail->date_from,
|
||||
$objBookingDetail->date_to
|
||||
);
|
||||
if ($numDays > 1) {
|
||||
$qty *= $numDays;
|
||||
}
|
||||
}
|
||||
$objBookingDemand->total_price_tax_excl = $objBookingDemand->unit_price_tax_excl * $qty;
|
||||
$objBookingDemand->total_price_tax_incl = $objBookingDemand->unit_price_tax_incl * $qty;
|
||||
|
||||
$objBookingDemand->total_price_tax_excl = Tools::processPriceRounding(($objBookingDemand->unit_price_tax_excl * $numDays));
|
||||
$objBookingDemand->total_price_tax_incl = Tools::processPriceRounding(($objBookingDemand->unit_price_tax_incl * $numDays));
|
||||
|
||||
$objBookingDemand->price_calc_method = $objGlobalDemand->price_calc_method;
|
||||
$objBookingDemand->id_tax_rules_group = $objGlobalDemand->id_tax_rules_group;
|
||||
|
||||
@@ -3800,6 +3800,27 @@ exit;
|
||||
}
|
||||
return $base;
|
||||
}
|
||||
|
||||
public static function processPriceRounding($value, $qty = 1, $roundType = null, $roundMode = null)
|
||||
{
|
||||
if (!$roundType) {
|
||||
$roundType = Configuration::get('PS_ROUND_TYPE');
|
||||
}
|
||||
switch ($roundType) {
|
||||
case Order::ROUND_TOTAL:
|
||||
$value = $value;
|
||||
break;
|
||||
case Order::ROUND_LINE:
|
||||
$value = Tools::ps_round(($value * $qty), _PS_PRICE_COMPUTE_PRECISION_, $roundMode);
|
||||
break;
|
||||
case Order::ROUND_ITEM:
|
||||
default:
|
||||
$value = Tools::ps_round($value, _PS_PRICE_COMPUTE_PRECISION_, $roundMode) * $qty;
|
||||
break;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2535,20 +2535,8 @@ class OrderCore extends ObjectModel
|
||||
}
|
||||
foreach ($tax_calculator->getTaxesAmount($discounted_price_tax_excl) as $id_tax => $unit_amount) {
|
||||
$total_tax_base = 0;
|
||||
switch ($round_type) {
|
||||
case Order::ROUND_ITEM:
|
||||
$total_tax_base = $quantity * Tools::ps_round($discounted_price_tax_excl, _PS_PRICE_COMPUTE_PRECISION_, $this->round_mode);
|
||||
$total_amount = $quantity * Tools::ps_round($unit_amount, _PS_PRICE_COMPUTE_PRECISION_, $this->round_mode);
|
||||
break;
|
||||
case Order::ROUND_LINE:
|
||||
$total_tax_base = Tools::ps_round($quantity * $discounted_price_tax_excl, _PS_PRICE_COMPUTE_PRECISION_, $this->round_mode);
|
||||
$total_amount = Tools::ps_round($quantity * $unit_amount, _PS_PRICE_COMPUTE_PRECISION_, $this->round_mode);
|
||||
break;
|
||||
case Order::ROUND_TOTAL:
|
||||
$total_tax_base = $quantity * $discounted_price_tax_excl;
|
||||
$total_amount = $quantity * $unit_amount;
|
||||
break;
|
||||
}
|
||||
$total_tax_base = Tools::processPriceRounding($discounted_price_tax_excl, $quantity);
|
||||
$totalPrice = Tools::processPriceRounding($unit_amount, $quantity);
|
||||
|
||||
if (!isset($breakdown[$id_tax])) {
|
||||
$breakdown[$id_tax] = array('tax_base' => 0, 'tax_amount' => 0);
|
||||
|
||||
@@ -398,22 +398,10 @@ class OrderDetailCore extends ObjectModel
|
||||
|
||||
$values = '';
|
||||
foreach ($this->tax_calculator->getTaxesAmount($discounted_price_tax_excl) as $id_tax => $amount) {
|
||||
switch (Configuration::get('PS_ROUND_TYPE')) {
|
||||
case Order::ROUND_ITEM:
|
||||
$unit_amount = (float)Tools::ps_round($amount, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$total_amount = $unit_amount * $this->product_quantity;
|
||||
break;
|
||||
case Order::ROUND_LINE:
|
||||
$unit_amount = $amount;
|
||||
$total_amount = Tools::ps_round($unit_amount * $this->product_quantity, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
break;
|
||||
case Order::ROUND_TOTAL:
|
||||
$unit_amount = $amount;
|
||||
$total_amount = $unit_amount * $this->product_quantity;
|
||||
break;
|
||||
}
|
||||
|
||||
$values .= '('.(int)$this->id.','.(int)$id_tax.','.(float)$unit_amount.','.(float)$total_amount.'),';
|
||||
$total_amount = Tools::processPriceRounding($unit_amount, $this->product_quantity, $order->round_type, $order->round_mode);
|
||||
|
||||
$values .= '('.(int)$this->id.','.(int)$id_tax.','.(float)$amount.','.(float)$total_amount.'),';
|
||||
}
|
||||
|
||||
if ($replace) {
|
||||
|
||||
@@ -283,7 +283,6 @@ class OrderSlipCore extends ObjectModel
|
||||
|
||||
/**
|
||||
* @deprecated since 1.6.0.10 use OrderSlip::create() instead
|
||||
*
|
||||
*/
|
||||
public static function createOrderSlip($order, $productList, $qtyList, $shipping_cost = false)
|
||||
{
|
||||
@@ -374,49 +373,55 @@ class OrderSlipCore extends ObjectModel
|
||||
$id_tax_rules_group = Product::getIdTaxRulesGroupByIdProduct((int)$order_detail->product_id);
|
||||
$tax_calculator = TaxManagerFactory::getManager($address, $id_tax_rules_group)->getTaxCalculator();
|
||||
|
||||
$order_slip->{'total_products_tax_'.$inc_or_ex_1} += $price * $numDays;
|
||||
|
||||
if (in_array(Configuration::get('PS_ROUND_TYPE'), array(Order::ROUND_ITEM, Order::ROUND_LINE))) {
|
||||
if (!isset($total_products[$id_tax_rules_group])) {
|
||||
$total_products[$id_tax_rules_group] = 0;
|
||||
}
|
||||
} else {
|
||||
$ps_round_type = Configuration::get('PS_ROUND_TYPE');
|
||||
if ($ps_round_type == Order::ROUND_TOTAL) {
|
||||
if (!isset($total_products[$id_tax_rules_group.'_'.$id_address])) {
|
||||
$total_products[$id_tax_rules_group.'_'.$id_address] = 0;
|
||||
}
|
||||
} else {
|
||||
if (!isset($total_products[$id_tax_rules_group])) {
|
||||
$total_products[$id_tax_rules_group] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$product_tax_incl_line = Tools::ps_round($tax_calculator->{$add_or_remove.'Taxes'}($price) * $numDays, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$product_tax_inc_or_ex_1 = Tools::processPriceRounding(
|
||||
($price * $numDays),
|
||||
1,
|
||||
$order->round_type,
|
||||
$order->round_mode
|
||||
);
|
||||
|
||||
switch (Configuration::get('PS_ROUND_TYPE')) {
|
||||
case Order::ROUND_ITEM:
|
||||
$product_tax_incl = Tools::ps_round($tax_calculator->{$add_or_remove.'Taxes'}($price), _PS_PRICE_COMPUTE_PRECISION_) * $numDays;
|
||||
$total_products[$id_tax_rules_group] += $product_tax_incl;
|
||||
break;
|
||||
case Order::ROUND_LINE:
|
||||
$product_tax_incl = $product_tax_incl_line;
|
||||
$total_products[$id_tax_rules_group] += $product_tax_incl;
|
||||
break;
|
||||
case Order::ROUND_TOTAL:
|
||||
$product_tax_incl = $product_tax_incl_line;
|
||||
$total_products[$id_tax_rules_group.'_'.$id_address] += $price * $numDays;
|
||||
break;
|
||||
$order_slip->{'total_products_tax_'.$inc_or_ex_1} += $product_tax_inc_or_ex_1;
|
||||
|
||||
$product_tax_inc_or_ex_2 = Tools::processPriceRounding(
|
||||
($tax_calculator->{$add_or_remove.'Taxes'}($price * $numDays)),
|
||||
1,
|
||||
$order->round_type,
|
||||
$order->round_mode
|
||||
);
|
||||
if ($ps_round_type == Order::ROUND_TOTAL) {
|
||||
$total_products[$id_tax_rules_group.'_'.$id_address] += $product_tax_inc_or_ex_2;
|
||||
} else {
|
||||
$total_products[$id_tax_rules_group] += $product_tax_inc_or_ex_2;
|
||||
}
|
||||
|
||||
$booking['unit_price_tax_'.$inc_or_ex_1] = $price;
|
||||
$booking['unit_price_tax_'.$inc_or_ex_2] = Tools::ps_round($tax_calculator->{$add_or_remove.'Taxes'}($price), _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$booking['total_price_tax_'.$inc_or_ex_1] = Tools::ps_round($price * $numDays, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$booking['total_price_tax_'.$inc_or_ex_2] = Tools::ps_round($product_tax_incl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$booking['unit_price_tax_'.$inc_or_ex_2] = $tax_calculator->{$add_or_remove.'Taxes'}($price);
|
||||
$booking['total_price_tax_'.$inc_or_ex_1] = $product_tax_inc_or_ex_1;
|
||||
$booking['total_price_tax_'.$inc_or_ex_2] = $product_tax_inc_or_ex_2;
|
||||
}
|
||||
|
||||
unset($product);
|
||||
|
||||
foreach ($total_products as $key => $price) {
|
||||
if (Configuration::get('PS_ROUND_TYPE') == Order::ROUND_TOTAL) {
|
||||
$tmp = explode('_', $key);
|
||||
$address = Address::initialize((int)$tmp[1], true);
|
||||
$tax_calculator = TaxManagerFactory::getManager($address, $tmp[0])->getTaxCalculator();
|
||||
$order_slip->{'total_products_tax_'.$inc_or_ex_2} += Tools::ps_round($tax_calculator->{$add_or_remove.'Taxes'}($price), _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$order_slip->{'total_products_tax_'.$inc_or_ex_2} += Tools::processPriceRounding(
|
||||
($tax_calculator->{$add_or_remove.'Taxes'}($price)),
|
||||
1,
|
||||
$order->round_type,
|
||||
$order->round_mode
|
||||
);
|
||||
} else {
|
||||
$order_slip->{'total_products_tax_'.$inc_or_ex_2} += $price;
|
||||
}
|
||||
|
||||
@@ -841,6 +841,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
$cart['total_price'] = Tools::displayPrice($cart_obj->getOrderTotal(), $currency);
|
||||
}
|
||||
}
|
||||
|
||||
if (count($orders)) {
|
||||
foreach ($orders as &$order) {
|
||||
$order['total_paid_real'] = Tools::displayPrice($order['total_paid_real'], $currency);
|
||||
@@ -1113,11 +1114,14 @@ class AdminCartsControllerCore extends AdminController
|
||||
$dateTo,
|
||||
$idRoom
|
||||
)) {
|
||||
$selectedRoomServiceProduct['selected_service'] = $objRoomTypeServiceProductCartDetail->getRoomServiceProducts(
|
||||
$selectedRoomServiceProduct['id'],
|
||||
$selectedRoomServiceProduct['selected_service'] = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
$idCart,
|
||||
0,
|
||||
null,
|
||||
null
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
$selectedRoomServiceProduct['id'],
|
||||
);
|
||||
}
|
||||
$this->context->smarty->assign(array(
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1032,11 +1032,14 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, true, 1);
|
||||
$cartRooms = $objCartBookingData->getHotelCartRoomsInfoByRoomType($this->context->cart->id, $idProduct,$dateFrom, $dateTo);
|
||||
foreach($cartRooms as &$room) {
|
||||
$room['selected_service'] = $objRoomTypeServiceProductCartDetail->getRoomServiceProducts(
|
||||
$room['id'],
|
||||
$room['selected_service'] = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
$room['id_cart'],
|
||||
0,
|
||||
null,
|
||||
null
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
$room['id']
|
||||
);
|
||||
}
|
||||
$this->context->smarty->assign(array(
|
||||
|
||||
@@ -885,7 +885,7 @@
|
||||
<value>1</value>
|
||||
</configuration>
|
||||
<configuration id="PS_ROUND_TYPE" name="PS_ROUND_TYPE">
|
||||
<value>2</value>
|
||||
<value>1</value>
|
||||
</configuration>
|
||||
<configuration id="PS_PRICE_DISPLAY_PRECISION" name="PS_PRICE_DISPLAY_PRECISION">
|
||||
<value>2</value>
|
||||
|
||||
@@ -119,9 +119,9 @@ class HotelBookingDemands extends ObjectModel
|
||||
if ($getTotalPrice) {
|
||||
foreach ($roomTypeDemands as $demand) {
|
||||
if ($useTax) {
|
||||
$totalDemandsPrice += $demand['total_price_tax_incl'];
|
||||
$totalDemandsPrice += Tools::processPriceRounding($demand['total_price_tax_incl']);
|
||||
} else {
|
||||
$totalDemandsPrice += $demand['total_price_tax_excl'];
|
||||
$totalDemandsPrice += Tools::processPriceRounding($demand['total_price_tax_excl']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -202,24 +202,11 @@ class HotelBookingDemands extends ObjectModel
|
||||
$objBkDetail = new HotelBookingDetail($this->id_htl_booking);
|
||||
$quantity = $objBkDetail->getNumberOfDays($objBkDetail->date_from, $objBkDetail->date_to);
|
||||
}
|
||||
switch (Configuration::get('PS_ROUND_TYPE')) {
|
||||
case Order::ROUND_ITEM:
|
||||
$unitAmount = (float)Tools::ps_round($amount, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$totalAmount = $unitAmount * $quantity;
|
||||
break;
|
||||
case Order::ROUND_LINE:
|
||||
$unitAmount = $amount;
|
||||
$totalAmount = Tools::ps_round(
|
||||
$unitAmount * $quantity,
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
break;
|
||||
case Order::ROUND_TOTAL:
|
||||
$unitAmount = $amount;
|
||||
$totalAmount = $unitAmount * $quantity;
|
||||
break;
|
||||
}
|
||||
$values .= '('.(int)$this->id.','.(int)$idTax.','.(float)$unitAmount.','.
|
||||
|
||||
// Rounding as per configurations
|
||||
$totalAmount += Tools::processPriceRounding($amount, $quantity);
|
||||
|
||||
$values .= '('.(int)$this->id.','.(int)$idTax.','.(float)$amount.','.
|
||||
(float)$totalAmount.'),';
|
||||
}
|
||||
|
||||
@@ -274,29 +261,15 @@ class HotelBookingDemands extends ObjectModel
|
||||
if ($taxDetails) {
|
||||
foreach ($taxDetails as &$detail) {
|
||||
$priceTaxExcl = $detail['unit_price_tax_excl'];
|
||||
$quantity = 1;
|
||||
$numDays = 1;
|
||||
$objBkDemand = new HotelBookingDemands($detail['id_booking_demand']);
|
||||
if ($objBkDemand->price_calc_method == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY) {
|
||||
$objBkDetail = new HotelBookingDetail($detail['id_htl_booking']);
|
||||
$quantity = $objBkDetail->getNumberOfDays($objBkDetail->date_from, $objBkDetail->date_to);
|
||||
}
|
||||
switch (Configuration::get('PS_ROUND_TYPE')) {
|
||||
case Order::ROUND_ITEM:
|
||||
$unitAmount = (float)Tools::ps_round($priceTaxExcl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$totalTaxBase = $unitAmount * $quantity;
|
||||
break;
|
||||
case Order::ROUND_LINE:
|
||||
$unitAmount = $priceTaxExcl;
|
||||
$totalTaxBase = Tools::ps_round(
|
||||
$unitAmount * $quantity,
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
break;
|
||||
case Order::ROUND_TOTAL:
|
||||
$unitAmount = $priceTaxExcl;
|
||||
$totalTaxBase = $unitAmount * $quantity;
|
||||
break;
|
||||
$numDays = $objBkDetail->getNumberOfDays($objBkDetail->date_from, $objBkDetail->date_to);
|
||||
}
|
||||
|
||||
$totalTaxBase = $unitAmount * $numDays;
|
||||
|
||||
$detail['total_tax_base'] = $totalTaxBase;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1902,6 +1902,7 @@ class HotelBookingDetail extends ObjectModel
|
||||
public function reallocateBooking($idHotelBooking, $idRoom, $priceDiffTaxExcl = 0)
|
||||
{
|
||||
$result = true;
|
||||
$reallocatedBookingId = 0;
|
||||
// get the cart booking data for the given booking
|
||||
if (Validate::isLoadedObject($objOldHotelBooking = new HotelBookingDetail($idHotelBooking))) {
|
||||
$objHotelRoomInfo = new HotelRoomInformation($idRoom);
|
||||
@@ -1912,7 +1913,10 @@ class HotelBookingDetail extends ObjectModel
|
||||
|
||||
$productQty = (int)$objOldHotelBooking->getNumberOfDays($objOldHotelBooking->date_from, $objOldHotelBooking->date_to);
|
||||
$oldRoomPriceTaxExcl = $objOldHotelBooking->total_price_tax_excl / $productQty;
|
||||
$newRoomPriceTaxExcl = $oldRoomPriceTaxExcl + $priceDiffTaxExcl;
|
||||
|
||||
// Calculate new room price per qty
|
||||
$priceDiffPerQtyTaxExcl = $priceDiffTaxExcl / $productQty;
|
||||
$newRoomPriceTaxExcl = $oldRoomPriceTaxExcl + $priceDiffPerQtyTaxExcl;
|
||||
|
||||
$totalRoomPriceTaxIncl = $objOldHotelBooking->total_price_tax_incl;
|
||||
$totalRoomPriceTaxExcl = $objOldHotelBooking->total_price_tax_excl;
|
||||
@@ -1936,6 +1940,7 @@ class HotelBookingDetail extends ObjectModel
|
||||
$cart->add();
|
||||
|
||||
// Save context (in order to apply cart rule)
|
||||
$this->context = Context::getContext();
|
||||
$this->context->cart = $cart;
|
||||
$this->context->customer = new Customer($objOrder->id_customer);
|
||||
$this->context->currency = new Currency($objOrder->id_currency);
|
||||
@@ -1947,7 +1952,7 @@ class HotelBookingDetail extends ObjectModel
|
||||
$idNewRoomType,
|
||||
$useTaxes,
|
||||
null,
|
||||
2,
|
||||
6,
|
||||
null,
|
||||
false,
|
||||
true,
|
||||
@@ -1991,7 +1996,7 @@ class HotelBookingDetail extends ObjectModel
|
||||
$objCartBookingData->id_product = $roomInfo['id_product'];
|
||||
$objCartBookingData->id_room = $roomInfo['id_room'];
|
||||
$objCartBookingData->id_hotel = $roomInfo['id_hotel'];
|
||||
$objCartBookingData->booking_type = 1;
|
||||
$objCartBookingData->booking_type = Self::ALLOTMENT_MANUAL;
|
||||
$objCartBookingData->quantity = $productQty;
|
||||
$objCartBookingData->date_from = $objOldHotelBooking->date_from;
|
||||
$objCartBookingData->date_to = $objOldHotelBooking->date_to;
|
||||
@@ -2016,18 +2021,6 @@ class HotelBookingDetail extends ObjectModel
|
||||
return false;
|
||||
}
|
||||
|
||||
$totalRoomTypePrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$idNewRoomType,
|
||||
$objCartBookingData->date_from,
|
||||
$objCartBookingData->date_to,
|
||||
0,
|
||||
Group::getCurrent()->id,
|
||||
$this->context->cart->id,
|
||||
$this->context->cookie->id_guest,
|
||||
$objCartBookingData->id_room,
|
||||
0
|
||||
);
|
||||
|
||||
// Add product to cart
|
||||
$updateQuantity = $cart->updateQty(
|
||||
$productQty,
|
||||
@@ -2046,7 +2039,7 @@ class HotelBookingDetail extends ObjectModel
|
||||
$objOrderInvoice->total_paid_tax_incl += (float)($cart->getOrderTotal($useTaxes, $totalMethod));
|
||||
$objOrderInvoice->total_products += (float)$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS);
|
||||
$objOrderInvoice->total_products_wt += (float)$cart->getOrderTotal($useTaxes, Cart::ONLY_PRODUCTS);
|
||||
$objOrderInvoice->update();
|
||||
$result &= $objOrderInvoice->update();
|
||||
}
|
||||
|
||||
// Create Order detail information
|
||||
@@ -2062,7 +2055,7 @@ class HotelBookingDetail extends ObjectModel
|
||||
$objOrder->total_paid_tax_incl += (float)($cart->getOrderTotal($useTaxes, $totalMethod));
|
||||
|
||||
// Save changes of order
|
||||
$objOrder->update();
|
||||
$result &= $objOrder->update();
|
||||
|
||||
// Update Tax lines
|
||||
$objOrderDetail->updateTaxAmount($objOrder);
|
||||
@@ -2091,7 +2084,6 @@ class HotelBookingDetail extends ObjectModel
|
||||
$objBookingDetail->id_customer = $objOrder->id_customer;
|
||||
$objBookingDetail->booking_type = $objCartBookingData->booking_type;
|
||||
$objBookingDetail->id_status = 1;
|
||||
$objBookingDetail->comment = $objCartBookingData->comment;
|
||||
$objBookingDetail->room_type_name = Product::getProductName($idNewRoomType, null, $objOrder->id_lang);
|
||||
|
||||
$objBookingDetail->date_from = $objCartBookingData->date_from;
|
||||
@@ -2135,7 +2127,8 @@ class HotelBookingDetail extends ObjectModel
|
||||
$objBookingDetail->check_out_time = $objHotelBranch->check_out;
|
||||
}
|
||||
|
||||
if ($objBookingDetail->save()) {
|
||||
if ($result &= $objBookingDetail->save()) {
|
||||
$reallocatedBookingId = $objBookingDetail->id;
|
||||
// Get Booking Demands of the old booking to add in the new booking creation
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
if ($oldBookingDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
@@ -2167,10 +2160,12 @@ class HotelBookingDetail extends ObjectModel
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
// delete cart feature prices after room addition success
|
||||
HotelRoomTypeFeaturePricing::deleteByIdCart($this->context->cart->id);
|
||||
// HotelRoomTypeFeaturePricing::deleteByIdCart($this->context->cart->id);
|
||||
|
||||
// ===============================================================
|
||||
// END: Add Process of the old booking
|
||||
@@ -2184,58 +2179,94 @@ class HotelBookingDetail extends ObjectModel
|
||||
$deleteQty = true;
|
||||
} else {
|
||||
// Calculate differences of price (Before / After)
|
||||
|
||||
$objOldOrderDetail->total_price_tax_incl -= $totalRoomPriceTaxIncl;
|
||||
$objOldOrderDetail->total_price_tax_excl -= $totalRoomPriceTaxExcl;
|
||||
$objOldOrderDetail->total_price_tax_incl -= Tools::processPriceRounding(
|
||||
($objOldOrderDetail->total_price_tax_incl - $totalRoomPriceTaxIncl),
|
||||
1,
|
||||
$objOrder->round_type,
|
||||
$objOrder->round_mode
|
||||
);
|
||||
$objOldOrderDetail->total_price_tax_excl -= Tools::processPriceRounding(
|
||||
($objOldOrderDetail->total_price_tax_excl - $totalRoomPriceTaxExcl),
|
||||
1,
|
||||
$objOrder->round_type,
|
||||
$objOrder->round_mode
|
||||
);
|
||||
|
||||
$old_quantity = $objOldOrderDetail->product_quantity;
|
||||
|
||||
$objOldOrderDetail->product_quantity = $old_quantity - $product_quantity;
|
||||
$objOldOrderDetail->product_quantity = $old_quantity - $productQty;
|
||||
$objOldOrderDetail->reduction_percent = 0;
|
||||
|
||||
// update taxes
|
||||
$res &= $objOldOrderDetail->updateTaxAmount($objOrder);
|
||||
$result &= $objOldOrderDetail->updateTaxAmount($objOrder);
|
||||
|
||||
// Save order detail
|
||||
$res &= $objOldOrderDetail->update();
|
||||
$result &= $objOldOrderDetail->update();
|
||||
}
|
||||
|
||||
// Update OrderInvoice of this OrderDetail
|
||||
if ($objOldOrderDetail->id_order_invoice != 0) {
|
||||
// values changes as values are calculated accoding to the quantity of the product by webkul
|
||||
$objOrderInvoice = new OrderInvoice($objOldOrderDetail->id_order_invoice);
|
||||
$objOrderInvoice->total_paid_tax_excl -= $totalRoomPriceTaxExcl;
|
||||
$objOrderInvoice->total_paid_tax_excl = Tools::ps_round(
|
||||
($objOrderInvoice->total_paid_tax_excl - $totalRoomPriceTaxExcl),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrderInvoice->total_paid_tax_excl = $objOrderInvoice->total_paid_tax_excl > 0 ? $objOrderInvoice->total_paid_tax_excl : 0;
|
||||
|
||||
$objOrderInvoice->total_paid_tax_incl -= $totalRoomPriceTaxIncl;
|
||||
$objOrderInvoice->total_paid_tax_incl = Tools::ps_round(
|
||||
($objOrderInvoice->total_paid_tax_incl - $totalRoomPriceTaxIncl),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrderInvoice->total_paid_tax_incl = $objOrderInvoice->total_paid_tax_incl > 0 ? $objOrderInvoice->total_paid_tax_incl : 0;
|
||||
|
||||
$objOrderInvoice->total_products -= $totalRoomPriceTaxExcl;
|
||||
$objOrderInvoice->total_products = Tools::ps_round(
|
||||
($objOrderInvoice->total_products - $totalRoomPriceTaxExcl),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrderInvoice->total_products = $objOrderInvoice->total_products > 0 ? $objOrderInvoice->total_products : 0;
|
||||
|
||||
$objOrderInvoice->total_products_wt -= $totalRoomPriceTaxIncl;
|
||||
$objOrderInvoice->total_products_wt = Tools::ps_round(
|
||||
($objOrderInvoice->total_products_wt - $totalRoomPriceTaxIncl),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrderInvoice->total_products_wt = $objOrderInvoice->total_products_wt > 0 ? $objOrderInvoice->total_products_wt : 0;
|
||||
|
||||
$res &= $objOrderInvoice->update();
|
||||
$result &= $objOrderInvoice->update();
|
||||
}
|
||||
|
||||
// values changes as values are calculated accoding to the quantity of the product by webkul
|
||||
$objOrder->total_paid -= $totalRoomPriceTaxIncl;
|
||||
$objOrder->total_paid = Tools::ps_round(
|
||||
($objOrder->total_paid_tax_incl - $totalRoomPriceTaxIncl),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_paid = $objOrder->total_paid > 0 ? $objOrder->total_paid : 0;
|
||||
|
||||
$objOrder->total_paid_tax_incl -= $totalRoomPriceTaxIncl;
|
||||
$objOrder->total_paid_tax_incl = Tools::ps_round(
|
||||
($objOrder->total_paid_tax_incl - $totalRoomPriceTaxIncl),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_paid_tax_incl = $objOrder->total_paid_tax_incl > 0 ? $objOrder->total_paid_tax_incl : 0;
|
||||
|
||||
$objOrder->total_paid_tax_excl -= $totalRoomPriceTaxExcl;
|
||||
$objOrder->total_paid_tax_excl = Tools::ps_round(
|
||||
($objOrder->total_paid_tax_excl - $totalRoomPriceTaxExcl),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_paid_tax_excl = $objOrder->total_paid_tax_excl > 0 ? $objOrder->total_paid_tax_excl : 0;
|
||||
|
||||
$objOrder->total_products -= $totalRoomPriceTaxExcl;
|
||||
$objOrder->total_products = Tools::ps_round(
|
||||
($objOrder->total_products - $totalRoomPriceTaxExcl),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_products = $objOrder->total_products > 0 ? $objOrder->total_products : 0;
|
||||
|
||||
$objOrder->total_products_wt -= $totalRoomPriceTaxIncl;
|
||||
$objOrder->total_products_wt = Tools::ps_round(
|
||||
($objOrder->total_products_wt - $totalRoomPriceTaxIncl),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_products_wt = $objOrder->total_products_wt > 0 ? $objOrder->total_products_wt : 0;
|
||||
|
||||
$objOrder->update();
|
||||
$result &= $objOrder->update();
|
||||
|
||||
// Reinject quantity in stock
|
||||
$objOldOrderDetail->reinjectQuantity($objOldOrderDetail, $objOldOrderDetail->product_quantity, $deleteQty);
|
||||
@@ -2272,20 +2303,27 @@ class HotelBookingDetail extends ObjectModel
|
||||
// update in the hotel booking detail table
|
||||
$objOldHotelBooking->id_room = $idRoom;
|
||||
$objOldHotelBooking->room_num = $objHotelRoomInfo->room_num;
|
||||
$objOldHotelBooking->booking_type = Self::ALLOTMENT_MANUAL;
|
||||
// set backorder to 0 as available reallocate rooms will always be free
|
||||
$objOldHotelBooking->is_back_order = 0;
|
||||
|
||||
$result &= $objOldHotelBooking->save();
|
||||
|
||||
$reallocatedBookingId = $objOldHotelBooking->id;
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
if ($result && $reallocatedBookingId) {
|
||||
Hook::exec(
|
||||
'actionRoomReallocateAfter',
|
||||
array(
|
||||
'id_htl_booking' => $idHotelBooking,
|
||||
'id_room' => $idRoom
|
||||
'id_htl_booking_from' => $idHotelBooking,
|
||||
'id_htl_booking_to' => $reallocatedBookingId,
|
||||
)
|
||||
);
|
||||
|
||||
return $reallocatedBookingId;
|
||||
} else {
|
||||
$result = false;
|
||||
}
|
||||
} else {
|
||||
$result = false;
|
||||
@@ -2519,7 +2557,7 @@ class HotelBookingDetail extends ObjectModel
|
||||
$newDateFrom,
|
||||
$newDateTo,
|
||||
$occupancy,
|
||||
$newTotalPrice = null,
|
||||
$newTotalPrice,
|
||||
$idHotelBookingDetail
|
||||
) {
|
||||
$objHotelBookingDetail = new self((int) $idHotelBookingDetail);
|
||||
@@ -2535,19 +2573,7 @@ class HotelBookingDetail extends ObjectModel
|
||||
$objHotelCartBookingData = new HotelCartBookingData($idHotelCartBookingData);
|
||||
if (Validate::isLoadedObject($objHotelCartBookingData)) {
|
||||
// calculate new prices
|
||||
$newTotalPriceTE = '';
|
||||
$newTotalPriceTI = '';
|
||||
$newNumDays = $this->getNumberOfDays($newDateFrom, $newDateTo);
|
||||
if ($newTotalPrice) {
|
||||
$newTotalPriceTE = $newTotalPrice['tax_excl'];
|
||||
$newTotalPriceTI = $newTotalPrice['tax_incl'];
|
||||
} else {
|
||||
$oldNumDays = $this->getNumberOfDays($oldDateFrom, $oldDateTo);
|
||||
$unitRoomPriceTE = $objHotelBookingDetail->total_price_tax_excl / $oldNumDays;
|
||||
$unitRoomPriceTI = $objHotelBookingDetail->total_price_tax_incl / $oldNumDays;
|
||||
$newTotalPriceTE = $unitRoomPriceTE * $newNumDays;
|
||||
$newTotalPriceTI = $unitRoomPriceTI * $newNumDays;
|
||||
}
|
||||
|
||||
// update $objHotelCartBookingData
|
||||
$objHotelCartBookingData->date_from = $newDateFrom;
|
||||
@@ -2560,8 +2586,8 @@ class HotelBookingDetail extends ObjectModel
|
||||
// update $objHotelBookingDetail
|
||||
$objHotelBookingDetail->date_from = $newDateFrom;
|
||||
$objHotelBookingDetail->date_to = $newDateTo;
|
||||
$objHotelBookingDetail->total_price_tax_excl = Tools::ps_round($newTotalPriceTE, 6);
|
||||
$objHotelBookingDetail->total_price_tax_incl = Tools::ps_round($newTotalPriceTI, 6);
|
||||
$objHotelBookingDetail->total_price_tax_excl = $newTotalPrice['tax_excl'];
|
||||
$objHotelBookingDetail->total_price_tax_incl = $newTotalPrice['tax_incl'];
|
||||
$objHotelBookingDetail->adults = $occupancy['adults'];
|
||||
$objHotelBookingDetail->children = $occupancy['children'];
|
||||
$objHotelBookingDetail->child_ages = json_encode($occupancy['child_ages']);
|
||||
@@ -3324,10 +3350,10 @@ class HotelBookingDetail extends ObjectModel
|
||||
$objHotelBookingDemands = new HotelBookingDemands();
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
|
||||
$reduction_amount['total_price_tax_excl'] = Tools::ps_round((float) $this->total_price_tax_excl, 6);
|
||||
$reduction_amount['total_products_tax_excl'] = Tools::ps_round((float) $this->total_price_tax_excl, 6);
|
||||
$reduction_amount['total_price_tax_incl'] = Tools::ps_round((float) $this->total_price_tax_incl, 6);
|
||||
$reduction_amount['total_products_tax_incl'] = Tools::ps_round((float) $this->total_price_tax_incl, 6);
|
||||
$reduction_amount['total_price_tax_excl'] = (float) $this->total_price_tax_excl;
|
||||
$reduction_amount['total_products_tax_excl'] = (float) $this->total_price_tax_excl;
|
||||
$reduction_amount['total_price_tax_incl'] = (float) $this->total_price_tax_incl;
|
||||
$reduction_amount['total_products_tax_incl'] = (float) $this->total_price_tax_incl;
|
||||
|
||||
// reduce facilities amount from order and services_detail
|
||||
if ($roomDemands = $objHotelBookingDemands->getRoomTypeBookingExtraDemands(
|
||||
@@ -3343,8 +3369,8 @@ class HotelBookingDetail extends ObjectModel
|
||||
)) {
|
||||
foreach ($roomDemands as $roomDemand) {
|
||||
$objHotelBookingDemands = new HotelBookingDemands($roomDemand['id_booking_demand']);
|
||||
$reduction_amount['total_price_tax_excl'] += Tools::ps_round((float) $objHotelBookingDemands->total_price_tax_excl, 6);
|
||||
$reduction_amount['total_price_tax_incl'] += Tools::ps_round((float) $objHotelBookingDemands->total_price_tax_incl, 6);
|
||||
$reduction_amount['total_price_tax_excl'] += (float) $objHotelBookingDemands->total_price_tax_excl;
|
||||
$reduction_amount['total_price_tax_incl'] += (float) $objHotelBookingDemands->total_price_tax_incl;
|
||||
$objHotelBookingDemands->total_price_tax_excl = 0;
|
||||
$objHotelBookingDemands->total_price_tax_incl = 0;
|
||||
$objHotelBookingDemands->save();
|
||||
@@ -3359,10 +3385,10 @@ class HotelBookingDetail extends ObjectModel
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail(
|
||||
$roomService['id_room_type_service_product_order_detail']
|
||||
);
|
||||
$reduction_amount['total_price_tax_excl'] += Tools::ps_round((float) $objRoomTypeServiceProductOrderDetail->total_price_tax_excl, 6);
|
||||
$reduction_amount['total_products_tax_excl'] += Tools::ps_round((float) $objRoomTypeServiceProductOrderDetail->total_price_tax_excl, 6);
|
||||
$reduction_amount['total_price_tax_incl'] += Tools::ps_round((float) $objRoomTypeServiceProductOrderDetail->total_price_tax_incl, 6);
|
||||
$reduction_amount['total_products_tax_incl'] += Tools::ps_round((float) $objRoomTypeServiceProductOrderDetail->total_price_tax_incl, 6);
|
||||
$reduction_amount['total_price_tax_excl'] += (float) $objRoomTypeServiceProductOrderDetail->total_price_tax_excl;
|
||||
$reduction_amount['total_products_tax_excl'] += (float) $objRoomTypeServiceProductOrderDetail->total_price_tax_excl;
|
||||
$reduction_amount['total_price_tax_incl'] += (float) $objRoomTypeServiceProductOrderDetail->total_price_tax_incl;
|
||||
$reduction_amount['total_products_tax_incl'] += (float) $objRoomTypeServiceProductOrderDetail->total_price_tax_incl;
|
||||
|
||||
if (Validate::isLoadedObject($objOrderDetail = new OrderDetail($objRoomTypeServiceProductOrderDetail->id_order_detail))) {
|
||||
$objOrderDetail->product_quantity_refunded += $objRoomTypeServiceProductOrderDetail->quantity;
|
||||
@@ -3370,13 +3396,17 @@ class HotelBookingDetail extends ObjectModel
|
||||
$objOrderDetail->product_quantity_refunded = $objOrderDetail->product_quantity;
|
||||
}
|
||||
|
||||
$objOrderDetail->total_price_tax_excl = Tools::ps_round(
|
||||
($objOrderDetail->total_price_tax_excl - $objRoomTypeServiceProductOrderDetail->total_price_tax_excl),
|
||||
6
|
||||
$objOrderDetail->total_price_tax_excl -= Tools::processPriceRounding(
|
||||
$objOrderDetail->total_price_tax_excl,
|
||||
1,
|
||||
$objOrder->round_type,
|
||||
$objOrder->round_mode
|
||||
);
|
||||
$objOrderDetail->total_price_tax_incl = Tools::ps_round(
|
||||
($objOrderDetail->total_price_tax_incl - $objRoomTypeServiceProductOrderDetail->total_price_tax_incl),
|
||||
6
|
||||
$objOrderDetail->total_price_tax_incl -= Tools::processPriceRounding(
|
||||
$objOrderDetail->total_price_tax_incl,
|
||||
1,
|
||||
$objOrder->round_type,
|
||||
$objOrder->round_mode
|
||||
);
|
||||
|
||||
$objOrderDetail->save();
|
||||
@@ -3404,42 +3434,44 @@ class HotelBookingDetail extends ObjectModel
|
||||
|
||||
if (!$hasOrderDiscountOrPayment) {
|
||||
// reduce room amount from order and order detail
|
||||
$objOrderDetail->total_price_tax_incl = Tools::ps_round(
|
||||
($objOrderDetail->total_price_tax_incl - $this->total_price_tax_incl),
|
||||
6
|
||||
$objOrderDetail->total_price_tax_incl -= Tools::processPriceRounding(
|
||||
$this->total_price_tax_incl,
|
||||
1,
|
||||
$objOrder->round_type,
|
||||
$objOrder->round_mode
|
||||
);
|
||||
$objOrderDetail->total_price_tax_excl = Tools::ps_round(
|
||||
($objOrderDetail->total_price_tax_excl - $this->total_price_tax_excl),
|
||||
6
|
||||
|
||||
$objOrderDetail->total_price_tax_excl -= Tools::processPriceRounding(
|
||||
$this->total_price_tax_excl,
|
||||
1,
|
||||
$objOrder->round_type,
|
||||
$objOrder->round_mode
|
||||
);
|
||||
|
||||
if (Validate::isLoadedObject($objOrder = new Order($this->id_order))) {
|
||||
$objOrder->total_paid = Tools::ps_round(
|
||||
($objOrder->total_paid - $reduction_amount['total_price_tax_incl']),
|
||||
6
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_paid = $objOrder->total_paid > 0 ? $objOrder->total_paid : 0;
|
||||
|
||||
$objOrder->total_paid_tax_excl = Tools::ps_round(
|
||||
($objOrder->total_paid_tax_excl - $reduction_amount['total_price_tax_excl']),
|
||||
6
|
||||
$objOrder->total_paid_tax_excl = Tools::ps_round(($objOrder->total_paid_tax_excl - $reduction_amount['total_price_tax_excl']),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_paid_tax_excl = $objOrder->total_paid_tax_excl > 0 ? $objOrder->total_paid_tax_excl : 0;
|
||||
|
||||
$objOrder->total_paid_tax_incl = Tools::ps_round(
|
||||
($objOrder->total_paid_tax_incl - $reduction_amount['total_price_tax_incl']),
|
||||
6
|
||||
$objOrder->total_paid_tax_incl = Tools::ps_round(($objOrder->total_paid_tax_incl - $reduction_amount['total_price_tax_incl']),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_paid_tax_incl = $objOrder->total_paid_tax_incl > 0 ? $objOrder->total_paid_tax_incl : 0;
|
||||
|
||||
$objOrder->total_products = Tools::ps_round(
|
||||
($objOrder->total_products - $reduction_amount['total_products_tax_excl']),
|
||||
6
|
||||
$objOrder->total_products = Tools::ps_round(($objOrder->total_products - $reduction_amount['total_products_tax_excl']),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_products = $objOrder->total_products > 0 ? $objOrder->total_products : 0;
|
||||
|
||||
$objOrder->total_products_wt = Tools::ps_round(
|
||||
($objOrder->total_products_wt - $reduction_amount['total_products_tax_incl']),
|
||||
6
|
||||
$objOrder->total_products_wt = Tools::ps_round(($objOrder->total_products_wt - $reduction_amount['total_products_tax_incl']),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_products_wt = $objOrder->total_products_wt > 0 ? $objOrder->total_products_wt : 0;
|
||||
|
||||
|
||||
@@ -1170,13 +1170,16 @@ class HotelCartBookingData extends ObjectModel
|
||||
2,
|
||||
null
|
||||
);
|
||||
$cart_detail_data[$key]['selected_services'] = $objRoomTypeServiceProductCartDetail->getRoomServiceProducts(
|
||||
$value['id'],
|
||||
$cart_detail_data[$key]['selected_services'] = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
$value['id_cart'],
|
||||
0,
|
||||
null,
|
||||
null
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
$value['id']
|
||||
);
|
||||
$cart_detail_data[$key]['additional_service_price'] = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart(
|
||||
$cart_detail_data[$key]['additional_service_price'] = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
$id_cart,
|
||||
0,
|
||||
0,
|
||||
@@ -1184,9 +1187,10 @@ class HotelCartBookingData extends ObjectModel
|
||||
$value['date_from'],
|
||||
$value['date_to'],
|
||||
$value['id'],
|
||||
1,
|
||||
false
|
||||
);
|
||||
$cart_detail_data[$key]['additional_services_auto_add_price'] = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart(
|
||||
$cart_detail_data[$key]['additional_services_auto_add_price'] = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
$id_cart,
|
||||
0,
|
||||
0,
|
||||
@@ -1194,10 +1198,11 @@ class HotelCartBookingData extends ObjectModel
|
||||
$value['date_from'],
|
||||
$value['date_to'],
|
||||
$value['id'],
|
||||
1,
|
||||
false,
|
||||
1
|
||||
);
|
||||
$cart_detail_data[$key]['additional_services_auto_add_with_room_price'] = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart(
|
||||
$cart_detail_data[$key]['additional_services_auto_add_with_room_price'] = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
$id_cart,
|
||||
0,
|
||||
0,
|
||||
@@ -1205,12 +1210,13 @@ class HotelCartBookingData extends ObjectModel
|
||||
$value['date_from'],
|
||||
$value['date_to'],
|
||||
$value['id'],
|
||||
1,
|
||||
false,
|
||||
1,
|
||||
null,
|
||||
Product::PRICE_ADDITION_TYPE_WITH_ROOM
|
||||
);
|
||||
$cart_detail_data[$key]['additional_services_auto_add_independent_price'] = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart(
|
||||
$cart_detail_data[$key]['additional_services_auto_add_independent_price'] = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
$id_cart,
|
||||
0,
|
||||
0,
|
||||
@@ -1218,6 +1224,7 @@ class HotelCartBookingData extends ObjectModel
|
||||
$value['date_from'],
|
||||
$value['date_to'],
|
||||
$value['id'],
|
||||
1,
|
||||
false,
|
||||
1,
|
||||
null,
|
||||
@@ -1534,14 +1541,15 @@ class HotelCartBookingData extends ObjectModel
|
||||
$data_v['date_to'],
|
||||
1
|
||||
);
|
||||
$serviceProductPrice = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart(
|
||||
$serviceProductPrice = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
$context->cart->id,
|
||||
0,
|
||||
$data_v['id_hotel'],
|
||||
$data_v['id_product'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id']
|
||||
$data_v['id'],
|
||||
1
|
||||
);
|
||||
$totalAdditionalServicePrice = $demandPrice + $serviceProductPrice;
|
||||
|
||||
@@ -1698,6 +1706,7 @@ class HotelCartBookingData extends ObjectModel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $cartHotelData;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,9 +95,12 @@ class HotelRoomTypeDemandPrice extends ObjectModel
|
||||
}
|
||||
}
|
||||
}
|
||||
$totalDemandsPrice += $price;
|
||||
|
||||
// Rounding as per configurations
|
||||
$totalDemandsPrice += Tools::processPriceRounding($price);
|
||||
}
|
||||
}
|
||||
|
||||
return $totalDemandsPrice;
|
||||
}
|
||||
|
||||
|
||||
@@ -747,10 +747,13 @@ class HotelRoomTypeFeaturePricing extends ObjectModel
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($quantity) {
|
||||
$totalPrice['total_price_tax_incl'] = $totalPrice['total_price_tax_incl'] * $quantity;
|
||||
$totalPrice['total_price_tax_excl'] = $totalPrice['total_price_tax_excl'] * $quantity;
|
||||
|
||||
if (!$quantity) {
|
||||
$quantity = 1;
|
||||
}
|
||||
$totalPrice['total_price_tax_incl'] = Tools::processPriceRounding($totalPrice['total_price_tax_incl'], $quantity);
|
||||
$totalPrice['total_price_tax_excl'] = Tools::processPriceRounding($totalPrice['total_price_tax_excl'], $quantity);
|
||||
|
||||
return $totalPrice;
|
||||
}
|
||||
|
||||
|
||||
@@ -163,6 +163,7 @@ class RoomTypeServiceProduct extends ObjectModel
|
||||
$use_reduc
|
||||
);
|
||||
}
|
||||
|
||||
return $services;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,6 +132,9 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 1.6.1 use getServiceProductsInCart() instead
|
||||
*/
|
||||
public function getServiceProductsTotalInCart(
|
||||
$idCart,
|
||||
$idProduct = 0,
|
||||
@@ -145,61 +148,25 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
$id_address = null,
|
||||
$priceAdditionType = null
|
||||
) {
|
||||
if ($useTax === null)
|
||||
$useTax = Product::$_taxCalculationMethod == PS_TAX_EXC ? false : true;
|
||||
|
||||
$sql = 'SELECT rscd.`id_product`, rscd.`quantity`, cbd.`id_product` as `room_type_id_product`, cbd.`date_from`, cbd.`date_to`
|
||||
FROM `'._DB_PREFIX_.'htl_cart_booking_data` cbd
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_cart_detail` rscd ON(rscd.`htl_cart_booking_id` = cbd.`id`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = rscd.`id_product`)
|
||||
WHERE 1';
|
||||
|
||||
if (!is_null($autoAddToCart)) {
|
||||
$sql .= ' AND p.`auto_add_to_cart` = '. (int)$autoAddToCart;
|
||||
if ($autoAddToCart == 1 && !is_null($priceAdditionType)) {
|
||||
$sql .= ' AND p.`price_addition_type` = '.$priceAdditionType;
|
||||
}
|
||||
}
|
||||
if ($idCart) {
|
||||
$sql .= ' AND cbd.`id_cart`='.(int) $idCart;
|
||||
}
|
||||
if ($idProduct) {
|
||||
$sql .= ' AND rscd.`id_product`='.(int) $idProduct;
|
||||
}
|
||||
if ($idHotel) {
|
||||
$sql .= ' AND cbd.`id_hotel`='.(int) $idHotel;
|
||||
}
|
||||
if ($roomTypeIdProduct) {
|
||||
$sql .= ' AND cbd.`id_product`='.(int) $roomTypeIdProduct;
|
||||
}
|
||||
if ($dateFrom && $dateTo) {
|
||||
$sql .= ' AND cbd.`date_from` = \''.pSQL($dateFrom).'\' AND cbd.`date_to` = \''.pSQL($dateTo).'\'';
|
||||
}
|
||||
if ($htlCartBookingId) {
|
||||
$sql .= ' AND cbd.`id`='.(int) $htlCartBookingId;
|
||||
}
|
||||
$sql .= ' ORDER BY cbd.`id`';
|
||||
$totalPrice = 0;
|
||||
|
||||
$objRoomTypeServiceProductPrice = new RoomTypeServiceProductPrice();
|
||||
if ($serviceProducts = Db::getInstance()->executeS($sql)) {
|
||||
foreach ($serviceProducts as $product) {
|
||||
$qty = $product['quantity'] ? (int)$product['quantity'] : 1;
|
||||
$totalPrice += $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
$useTax,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
}
|
||||
}
|
||||
return $totalPrice;
|
||||
return $this->getServiceProductsInCart(
|
||||
$idCart,
|
||||
$idProduct,
|
||||
$idHotel,
|
||||
$roomTypeIdProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$htlCartBookingId,
|
||||
1,
|
||||
$useTax,
|
||||
$autoAddToCart,
|
||||
$id_address,
|
||||
$priceAdditionType
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 1.6.1 use getServiceProductsInCart() instead
|
||||
*/
|
||||
public function getRoomServiceProducts(
|
||||
$htlCartBookingId,
|
||||
$idLang = 0,
|
||||
@@ -208,129 +175,28 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
$id_address = null,
|
||||
$priceAdditionType = null
|
||||
) {
|
||||
if ($useTax === null)
|
||||
$useTax = Product::$_taxCalculationMethod == PS_TAX_EXC ? false : true;
|
||||
if (Validate::isLoadedObject($objHotelCartBookingData = new HotelCartBookingData($htlCartBookingId))) {
|
||||
$selectedServiceProducts = $this->getServiceProductsInCart(
|
||||
$objHotelCartBookingData->id_cart,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
$htlCartBookingId,
|
||||
0,
|
||||
$useTax,
|
||||
$autoAddToCart,
|
||||
$id_address,
|
||||
$priceAdditionType
|
||||
);
|
||||
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
$sql = 'SELECT rscd.`id_product`, rscd.`quantity`, cbd.`id_cart`, p.`auto_add_to_cart`, p.`allow_multiple_quantity`, cbd.`id` as `htl_cart_booking_id`,
|
||||
p.`price_addition_type`, cbd.`id_product` as `room_type_id_product`, pl.`name`, cbd.`date_from`, cbd.`date_to`
|
||||
FROM `'._DB_PREFIX_.'htl_cart_booking_data` cbd
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_type_service_product_cart_detail` rscd ON(rscd.`htl_cart_booking_id` = cbd.`id`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = rscd.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$idLang.')
|
||||
WHERE 1';
|
||||
|
||||
if (!is_null($autoAddToCart)) {
|
||||
$sql .= ' AND p.`auto_add_to_cart` = '. (int)$autoAddToCart;
|
||||
if ($autoAddToCart == 1 && !is_null($priceAdditionType)) {
|
||||
$sql .= ' AND p.`price_addition_type` = '.$priceAdditionType;
|
||||
if (isset($selectedServiceProducts[$htlCartBookingId]['selected_products_info'])) {
|
||||
return $selectedServiceProducts;
|
||||
}
|
||||
}
|
||||
if ($htlCartBookingId) {
|
||||
$sql .= ' AND cbd.`id`='.(int) $htlCartBookingId;
|
||||
}
|
||||
$sql .= ' ORDER BY cbd.`id`';
|
||||
|
||||
$objRoomTypeServiceProductPrice = new RoomTypeServiceProductPrice();
|
||||
$selectedServiceProducts = array();
|
||||
|
||||
if ($serviceProducts = Db::getInstance()->executeS($sql)) {
|
||||
foreach ($serviceProducts as $product) {
|
||||
$qty = $product['quantity'] ? (int)$product['quantity'] : 1;
|
||||
if (isset($selectedServiceProducts[$product['id_product']])) {
|
||||
$selectedServiceProducts[$product['id_product']]['quantity'] += $product['quantity'];
|
||||
$selectedServiceProducts[$product['id_product']]['total_price'] += $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
$useTax,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
$selectedServiceProducts[$product['id_product']]['total_price_tax_excl'] += $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
false,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
$selectedServiceProducts[$product['id_product']]['total_price_tax_incl'] += $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
true,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
} else {
|
||||
$selectedServiceProducts[$product['id_product']] = $product;
|
||||
|
||||
$selectedServiceProducts[$product['id_product']]['unit_price_tax_excl'] = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
1,
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
$selectedServiceProducts[$product['id_product']]['unit_price_tax_incl'] = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
1,
|
||||
null,
|
||||
null,
|
||||
true,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
$selectedServiceProducts[$product['id_product']]['total_price'] = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
$useTax,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
$selectedServiceProducts[$product['id_product']]['total_price_tax_excl'] = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
false,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
$selectedServiceProducts[$product['id_product']]['total_price_tax_incl'] = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
true,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $selectedServiceProducts;
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getServiceProductsInCart(
|
||||
@@ -404,12 +270,12 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
|
||||
if ($serviceProducts = Db::getInstance()->executeS($sql)) {
|
||||
foreach ($serviceProducts as $product) {
|
||||
$qty = $product['quantity'] ? (int)$product['quantity'] : 1;
|
||||
if ($getTotalPrice) {
|
||||
$qty = $product['quantity'] ? (int)$product['quantity'] : 1;
|
||||
$totalPrice += $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
$servicePrice = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
1,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
$useTax,
|
||||
@@ -417,8 +283,8 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
$id_address
|
||||
);
|
||||
|
||||
$totalPrice += Tools::processPriceRounding($servicePrice, $qty);
|
||||
} else {
|
||||
$qty = $product['quantity'] ? (int)$product['quantity'] : 1;
|
||||
if (isset($selectedServiceProducts[$product['htl_cart_booking_id']])) {
|
||||
if ($idProduct) {
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['quantity'] += $product['quantity'];
|
||||
@@ -452,36 +318,43 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
),
|
||||
);
|
||||
}
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price'] += $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
|
||||
$servicePrice = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
1,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
$useTax,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price_tax_excl'] += $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
|
||||
$servicePriceTE = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
1,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
false,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price_tax_incl'] += $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
|
||||
$servicePriceTI = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
1,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
true,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price'] += Tools::processPriceRounding($servicePrice, $qty);
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price_tax_excl'] += Tools::processPriceRounding($servicePriceTE, $qty);
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price_tax_incl'] += Tools::processPriceRounding($servicePriceTI, $qty);
|
||||
} else {
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['htl_cart_booking_id'] = $product['htl_cart_booking_id'];
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['id_cart'] = $product['id_cart'];
|
||||
@@ -553,40 +426,45 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
);
|
||||
}
|
||||
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price'] = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
$servicePrice = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
1,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
$useTax,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price_tax_excl'] = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
|
||||
$servicePriceTE = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
1,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
false,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price_tax_incl'] = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
|
||||
$servicePriceTI = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
(int)$product['room_type_id_product'],
|
||||
$qty,
|
||||
1,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
true,
|
||||
false,
|
||||
$id_address
|
||||
);
|
||||
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price'] = Tools::processPriceRounding($servicePrice, $qty);
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price_tax_excl'] = Tools::processPriceRounding($servicePriceTE, $qty);
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price_tax_incl'] = Tools::processPriceRounding($servicePriceTI, $qty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($getTotalPrice) {
|
||||
@@ -641,4 +519,4 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ class RoomTypeServiceProductPrice extends ObjectModel
|
||||
);
|
||||
}
|
||||
|
||||
public function getServicePrice($idProduct, $idProductRoomType, $quantity, $dateFrom = null, $dateTo = null, $useTax = null, $id_cart = false, $id_address = null, $use_reduc= 1)
|
||||
public function getServicePrice($idProduct, $idProductRoomType, $quantity = 1, $dateFrom = null, $dateTo = null, $useTax = null, $id_cart = false, $id_address = null, $use_reduc= 1)
|
||||
{
|
||||
if ($useTax === null)
|
||||
$useTax = Product::$_taxCalculationMethod == PS_TAX_EXC ? false : true;
|
||||
|
||||
@@ -149,11 +149,6 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
$occupancy = array();
|
||||
}
|
||||
|
||||
// $booking_product = 1;
|
||||
// if (Tools::getisset('booking_product')) {
|
||||
// $booking_product = Tools::getValue('booking_product');
|
||||
// }
|
||||
|
||||
$this->id_cart = (int) $this->context->cart->id;
|
||||
$this->id_guest = (int) $this->context->cookie->id_guest;
|
||||
$this->id_hotel = $id_hotel;
|
||||
@@ -177,7 +172,6 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
Tools::redirectAdmin($this->context->link->getAdminLink('AdminHotelRoomsBooking').'&'.http_build_query($urlData));
|
||||
}
|
||||
|
||||
// Process reallocation of rooms
|
||||
// Process reallocation of rooms
|
||||
if (Tools::isSubmit('realloc_allocated_rooms')) {
|
||||
if ($this->tabAccess['edit'] === '1') {
|
||||
@@ -204,7 +198,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
$this->errors[] = $this->l('Selected room is not available for reallocation.');
|
||||
} elseif (!in_array($idRoomToReallocate, array_column($availableRooms, 'id_room'))) {
|
||||
$this->errors[] = $this->l('Selected room is not available for reallocation.');
|
||||
} elseif (!Validate::isFloat($priceDiff)) {
|
||||
} elseif (!Validate::isPrice($priceDiff)) {
|
||||
$this->errors[] = $this->l('Invalid price difference of the room types.');
|
||||
}
|
||||
} else {
|
||||
@@ -216,7 +210,11 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
|
||||
if (!count($this->errors)) {
|
||||
// Finally, reallocate the room
|
||||
if ($objBookingDetail->reallocateBooking($idHtlBookingFrom, $idRoomToReallocate, $priceDiff)) {
|
||||
if ($reallocatedBookingId = $objBookingDetail->reallocateBooking($idHtlBookingFrom, $idRoomToReallocate, $priceDiff)) {
|
||||
$objHtlBookingDetail = new HotelBookingDetail($reallocatedBookingId);
|
||||
$objHtlBookingDetail->comment = $this->l('Room manually reallocated.');
|
||||
$objHtlBookingDetail->save();
|
||||
|
||||
Tools::redirectAdmin(self::$currentIndex.'&id_order='.(int) $idOrder.'&vieworder&conf=52&token='.$this->token);
|
||||
} else {
|
||||
$this->errors[] = $this->l('Some error occured. Please try again.');
|
||||
@@ -379,7 +377,8 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
|
||||
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
|
||||
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
|
||||
'link' => $this->context->link
|
||||
'link' => $this->context->link,
|
||||
'ALLOTMENT_MANUAL' => HotelBookingDetail::ALLOTMENT_MANUAL,
|
||||
));
|
||||
|
||||
if (Configuration::get('PS_BACKOFFICE_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
</td>
|
||||
<td>
|
||||
{if $rm_dtl_v['booking_type'] == HotelBookingDetail::ALLOTMENT_AUTO}
|
||||
<button type="button" class="btn btn-primary room_reallocate_swap" id="reallocate_room_{$rm_dtl_v['id_htl_booking']}" data-room_type_name="{$rm_dtl_v['room_type_name']}" data-id_htl_booking="{$rm_dtl_v['id_htl_booking']}" data-id_order="{$rm_dtl_v['id_order']}" data-room_num='{$booked_v['room_num']}' data-currency_sign='{$rm_dtl_v['currency_sign']}' data-id_room_type='{$booked_v['id_product']}' data-cust_name='{$rm_dtl_v['alloted_cust_name']}' data-cust_email='{$rm_dtl_v['alloted_cust_email']}' data-avail_rm_swap='{$rm_dtl_v['avail_rooms_to_swap']|@json_encode}' data-avail_realloc_room_types='{$rm_dtl_v['avail_room_types_to_realloc']|@json_encode}' data-allotment_type_label='{if $rm_dtl_v['booking_type'] == $ALLOTMENT_MANUAL}{l s='Manual'}{else}{l s='Auto'}{/if}' data-comment='{$rm_dtl_v.comment}'>
|
||||
<button type="button" class="btn btn-primary room_reallocate_swap" id="reallocate_room_{$rm_dtl_v.id_htl_booking}" data-room_type_name="{$rm_dtl_v.room_type_name}" data-id_htl_booking="{$rm_dtl_v.id_htl_booking}" data-id_order="{$rm_dtl_v.id_order}" data-room_num="{$booked_v.room_num}" data-currency_sign="{$rm_dtl_v.currency_sign}" data-id_room_type="{$booked_v.id_product}" data-cust_name="{$rm_dtl_v.alloted_cust_name}" data-cust_email="{$rm_dtl_v.alloted_cust_email}" data-avail_rm_swap='{$rm_dtl_v.avail_rooms_to_swap|@json_encode}' data-avail_realloc_room_types='{$rm_dtl_v.avail_room_types_to_realloc|@json_encode}' data-allotment_type_label="{if $rm_dtl_v.booking_type == $ALLOTMENT_MANUAL}{l s='Manual'}{else}{l s='Auto'}{/if}" data-comment="{$rm_dtl_v.comment}">
|
||||
{l s='Reallocate Room' mod='hotelreservationsystem'}
|
||||
</button>
|
||||
{else}
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="product header small" width="30%">{l s='Room Type / Reference' pdf='true'}</th>
|
||||
<th class="product header small" width="30%">{l s='Duration' pdf='true'}</th>
|
||||
<th class="product header small" width="35%">{l s='Room Type / Reference' pdf='true'}</th>
|
||||
<th class="product header small" width="35%">{l s='Duration' pdf='true'}</th>
|
||||
<th class="product header small" width="10%">{l s='Num rooms' pdf='true'}</th>
|
||||
<th class="product header-right small" width="15%">{l s='Unit price' pdf='true'}<br />{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}</th>
|
||||
<th class="product header-right small" width="15%">{l s='Price' pdf='true'}<br />{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}</th>
|
||||
{* <th class="product header-right small" width="15%">{l s='Unit price' pdf='true'}<br />{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}</th> *}
|
||||
<th class="product header-right small" width="20%">{l s='Total Price' pdf='true'}<br />{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -55,13 +55,13 @@
|
||||
<td class="product center">
|
||||
{$order_detail.num_rooms}
|
||||
</td>
|
||||
<td class="product right">
|
||||
{* <td class="product right">
|
||||
{if $tax_excluded_display}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl}
|
||||
{else}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_incl}
|
||||
{/if}
|
||||
</td>
|
||||
</td> *}
|
||||
<td class="product right">
|
||||
{if $tax_excluded_display}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_excl}
|
||||
|
||||
Reference in New Issue
Block a user