Merge pull request #636 from lakshya-webkul/gli-886

Resolved: refund request payment calculation
This commit is contained in:
Rohit Jain
2023-03-30 15:30:02 +05:30
committed by GitHub
20 changed files with 1020 additions and 871 deletions

View File

@@ -221,10 +221,14 @@
</div>
{/if}
</td>
{if isset($refundReqBookings) && $refundReqBookings}
{if (isset($refundReqBookings) && $refundReqBookings) || (isset($isCancelledRoom) && $isCancelledRoom)}
<td class="text-center">
{if isset($data.refund_info) && $data.refund_info}
{if $data.is_cancelled}
<span class="badge badge-danger">{l s='Cancelled'}</span>
{elseif isset($data.refund_info) && $data.refund_info}
<span class="badge" style="background-color:{$data.refund_info.color|escape:'html':'UTF-8'}">{$data.refund_info.name|escape:'html':'UTF-8'}</span>
{else}
<span>--</span>
{/if}
</td>
<td class="text-center">

View File

@@ -16,12 +16,12 @@
<th class="text-center"><span class="title_box">{l s='Extra Services/Fee (Tax excl.)'}</span></th>
<th class="text-center"><span class="title_box">{l s='Total Tax'}</span></th>
<th class="text-center"><span class="title_box">{l s='Total Price (Tax incl.)'}</span></th>
{if isset($refundReqBookings) && $refundReqBookings}
<th class="text-center"><span class="title_box">{l s='Refund State'}</span></th>
{if (isset($refundReqBookings) && $refundReqBookings) || (isset($isCancelledRoom) && $isCancelledRoom)}
<th class="text-center"><span class="title_box">{l s='Refund/Cancellation Status'}</span></th>
<th class="text-center"><span class="title_box">{l s='Refunded amount'}</span></th>
{/if}
{if ($can_edit && !$order->hasBeenDelivered())}
<th class="text-center"><span class="title_box">{l s='Edit Order'}</th>
<th class="text-center fixed-width-lg"><span class="title_box">{l s='Edit Order'}</th>
{/if}
</tr>
</thead>

View File

@@ -281,55 +281,57 @@
</tr>
{if isset($htl_booking_order_data) && $htl_booking_order_data}
{foreach from=$htl_booking_order_data item=data}
<tr>
<td>
{$data['room_num']}
</td>
<td>
<a href="{$link->getAdminLink('AdminAddHotel')}&amp;id={$data['id_hotel']}&amp;updatehtl_branch_info" target="_blank">
<span>{$data['hotel_name']}</span>
</a>
</td>
<td>
{dateFormat date=$data['date_from']} - {dateFormat date=$data['date_to']}
</td>
<td>
<a class="btn btn-default" onclick="BookingDocumentsModal.init({$data.id|intval}, this); return false;">
<i class="icon icon-file-text"></i>
{l s='Documents'} <span class="badge badge-info count-documents">{$data.num_checkin_documents}</span>
</a>
</td>
<td>
<form action="" method="post" class="form-horizontal row room_status_info_form">
<div class="col-sm-7">
<select name="booking_order_status" class="form-control booking_order_status margin-bottom-5">
{foreach from=$hotel_order_status item=state}
<option value="{$state['id_status']|intval}" {if isset($data.id_status) && $state.id_status == $data.id_status} selected="selected" disabled="disabled"{/if}>{$state.name|escape}</option>
{/foreach}
</select>
{if !$data.is_refunded}
<tr>
<td>
{$data['room_num']}
</td>
<td>
<a href="{$link->getAdminLink('AdminAddHotel')}&amp;id={$data['id_hotel']}&amp;updatehtl_branch_info" target="_blank">
<span>{$data['hotel_name']}</span>
</a>
</td>
<td>
{dateFormat date=$data['date_from']} - {dateFormat date=$data['date_to']}
</td>
<td>
<a class="btn btn-default" onclick="BookingDocumentsModal.init({$data.id|intval}, this); return false;">
<i class="icon icon-file-text"></i>
{l s='Documents'} <span class="badge badge-info count-documents">{$data.num_checkin_documents}</span>
</a>
</td>
<td>
<form action="" method="post" class="form-horizontal row room_status_info_form">
<div class="col-sm-7">
<select name="booking_order_status" class="form-control booking_order_status margin-bottom-5">
{foreach from=$hotel_order_status item=state}
<option value="{$state['id_status']|intval}" {if isset($data.id_status) && $state.id_status == $data.id_status} selected="selected" disabled="disabled"{/if}>{$state.name|escape}</option>
{/foreach}
</select>
{if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']}
<p class="text-center"><span class="badge badge-success margin-bottom-5">{l s='Checked in on'} {dateFormat date=$data['check_in']}</span></p>
{elseif $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']}
<p class="text-center"><span class="badge badge-success margin-bottom-5">{l s='Checked out on'} {dateFormat date=$data['check_out']}</span></p>
{/if}
{if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']}
<p class="text-center"><span class="badge badge-success margin-bottom-5">{l s='Checked in on'} {dateFormat date=$data['check_in']}</span></p>
{elseif $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']}
<p class="text-center"><span class="badge badge-success margin-bottom-5">{l s='Checked out on'} {dateFormat date=$data['check_out']}</span></p>
{/if}
{* field for the current date *}
<input class="room_status_date wk-input-date" type="text" name="status_date" value="{if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']}{$data['date_to']|date_format:"%d-%m-%Y"}{else}{$data['date_from']|date_format:"%d-%m-%Y"}{/if}" readonly/>
{* field for the current date *}
<input class="room_status_date wk-input-date" type="text" name="status_date" value="{if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']}{$data['date_to']|date_format:"%d-%m-%Y"}{else}{$data['date_from']|date_format:"%d-%m-%Y"}{/if}" readonly/>
<input type="hidden" name="date_from" value="{$data['date_from']|date_format:"%Y-%m-%d"}" />
<input type="hidden" name="date_to" value="{$data['date_to']|date_format:"%Y-%m-%d"}" />
<input type="hidden" name="id_room" value="{$data['id_room']}" />
<input type="hidden" name="id_order" value="{$order->id}" />
</div>
<div class="col-sm-5">
<button type="submit" name="submitbookingOrderStatus" class="btn btn-primary">
{l s='Update Status'}
</button>
</div>
</form>
</td>
</tr>
<input type="hidden" name="date_from" value="{$data['date_from']|date_format:"%Y-%m-%d"}" />
<input type="hidden" name="date_to" value="{$data['date_to']|date_format:"%Y-%m-%d"}" />
<input type="hidden" name="id_room" value="{$data['id_room']}" />
<input type="hidden" name="id_order" value="{$order->id}" />
</div>
<div class="col-sm-5">
<button type="submit" name="submitbookingOrderStatus" class="btn btn-primary">
{l s='Update Status'}
</button>
</div>
</form>
</td>
</tr>
{/if}
{/foreach}
{else}
<tr>
@@ -2101,4 +2103,4 @@
});
</script>
{/block}
{/block}

View File

@@ -3078,7 +3078,7 @@ class ProductCore extends ObjectModel
$address_infos = Address::getCountryAndState($id_address);
}
if (isset($address_infos['id_country'])) {
if (isset($address_infos['id_country']) && $address_infos['id_country']) {
$id_country = (int)$address_infos['id_country'];
$id_state = (int)$address_infos['id_state'];
$zipcode = $address_infos['postcode'];

View File

@@ -1781,7 +1781,7 @@ class OrderCore extends ObjectModel
// We put autodate parameter of add method to true if date_add field is null
if ($res = $order_payment->add(is_null($order_payment->date_add))) {
if ($update_payment_detail) {
$res &= $this->addOrderPaymentDetail($order_payment, $amount_paid, $order_invoice);
$res = $res && $this->addOrderPaymentDetail($order_payment, $amount_paid, $order_invoice);
}
}
@@ -2553,8 +2553,8 @@ class OrderCore extends ObjectModel
// $refundFlag [ORDER_RETURN_STATE_FLAG_REFUNDED || ORDER_RETURN_STATE_FLAG_DENIED]
public function hasCompletelyRefunded($refundFlag = 0)
{
$objHotelBooking = new HotelBookingdetail();
if ($refundBookings = OrderReturn::getOrdersReturnDetail($this->id)) {
$objHotelBooking = new HotelBookingdetail();
if ($orderBookings = $objHotelBooking->getOrderCurrentDataByOrderId($this->id)) {
if (count($refundBookings) == count($orderBookings)) {
if ($refundFlag) {
@@ -2578,6 +2578,12 @@ class OrderCore extends ObjectModel
return true;
}
}
} elseif ($orderBookings = $objHotelBooking->getOrderCurrentDataByOrderId($this->id)) {
if (count(array_unique(array_column($orderBookings, 'is_cancelled'))) === 1
&& array_unique(array_column($orderBookings, 'is_cancelled'))[0] != 0
) {
return true;
}
}
return false;
@@ -2599,4 +2605,4 @@ class OrderCore extends ObjectModel
'SELECT `id` FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `id_order` = '.(int)$this->id.' ORDER BY `id` ASC'
);
}
}
}

View File

@@ -198,51 +198,43 @@ class OrderReturnCore extends ObjectModel
$objBookingDemands = new HotelBookingDemands();
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
$objOrder = new Order($idOrder);
foreach ($returnDetails as &$bookingRow) {
$bookingRow['extra_demands_price_tax_incl'] = $objBookingDemands->getRoomTypeBookingExtraDemands(
$bookingRow['id_order'],
$bookingRow['id_product'],
$bookingRow['id_room'],
$bookingRow['date_from'],
$bookingRow['date_to'],
0,
1
);
$bookingRow['extra_demands_price_tax_excl'] = $objBookingDemands->getRoomTypeBookingExtraDemands(
$bookingRow['id_order'],
$bookingRow['id_product'],
$bookingRow['id_room'],
$bookingRow['date_from'],
$bookingRow['date_to'],
0,
1,
0
);
$bookingRow['additional_services_tax_excl'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$bookingRow['id_order'],
0,
0,
$bookingRow['id_product'],
$bookingRow['date_from'],
$bookingRow['date_to'],
$bookingRow['id_room'],
1,
0,
null
);
$bookingRow['additional_services_tax_incl'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$bookingRow['id_order'],
0,
0,
$bookingRow['id_product'],
$bookingRow['date_from'],
$bookingRow['date_to'],
$bookingRow['id_room'],
1,
1,
null
);
$bookingRow['extra_service_total_paid_amount'] = 0;
$bookingRow['extra_service_total_price_tax_incl'] = 0;
$bookingRow['room_paid_amount'] = 0;
if ($objOrder->total_paid_real > 0) {
if ($bookingRow['total_price_tax_incl'] > 0) {
$bookingRow['room_paid_amount'] = ($objOrder->total_paid_real*$bookingRow['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
}
$roomSelectedDemands = $objBookingDemands->getRoomTypeBookingExtraDemands(
$idOrder,
$bookingRow['id_product'],
$bookingRow['id_room'],
$bookingRow['date_from'],
$bookingRow['date_to'],
0
);
if (count($roomSelectedDemands)) {
foreach ($roomSelectedDemands as $demand) {
if ($demand['total_price_tax_incl'] > 0) {
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$demand['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
$bookingRow['extra_service_total_price_tax_incl'] += $demand['total_price_tax_incl'];
}
}
}
if ($roomSelectedServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom($bookingRow['id_htl_booking'])) {
if (count($roomSelectedServices['additional_services'])) {
foreach ($roomSelectedServices['additional_services'] as $service) {
if ($service['total_price_tax_incl'] > 0) {
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$service['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
$bookingRow['extra_service_total_price_tax_incl'] += $service['total_price_tax_incl'];
}
}
}
}
}
if ($customerView) {
$dateJoin = $bookingRow['id_product'].'_'.strtotime($bookingRow['date_from']).strtotime($bookingRow['date_to']);
if (isset($returnsCustView[$dateJoin]['num_rooms'])) {
@@ -250,10 +242,6 @@ class OrderReturnCore extends ObjectModel
$returnsCustView[$dateJoin]['refunded_amount'] += $bookingRow['refunded_amount'];
$returnsCustView[$dateJoin]['total_price_tax_incl'] += $bookingRow['total_price_tax_incl'];
$returnsCustView[$dateJoin]['total_paid_amount'] += $bookingRow['total_paid_amount'];
$returnsCustView[$dateJoin]['extra_demands_price_tax_incl'] += $bookingRow['extra_demands_price_tax_incl'];
$returnsCustView[$dateJoin]['extra_demands_price_tax_incl'] += $bookingRow['additional_services_tax_incl'];
$returnsCustView[$dateJoin]['extra_demands_price_tax_excl'] += $bookingRow['extra_demands_price_tax_excl'];
$returnsCustView[$dateJoin]['extra_demands_price_tax_excl'] += $bookingRow['additional_services_tax_excl'];
} else {
unset($bookingRow['id_room']);
unset($bookingRow['room_num']);
@@ -277,10 +265,12 @@ class OrderReturnCore extends ObjectModel
}
$sql = 'SELECT orr.`id_order`, orr.`state`, orr.`id_order_return`, orr.`payment_mode`, orr.`id_transaction`,
orr.`id_return_type`, orr.`return_type`, ors.`id_cart_rule`, orr.`date_add`, orr.`date_upd`,
COUNT(ord.`id_order_return_detail`) AS total_rooms
hbd.`is_cancelled`, COUNT(ord.`id_order_return_detail`) AS total_rooms
FROM `'._DB_PREFIX_.'order_return` orr
LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ord
ON (ord.`id_order_return` = orr.`id_order_return`)
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd
ON (hbd.`id` = ord.`id_htl_booking`)
LEFT JOIN `'._DB_PREFIX_.'order_slip` ors
ON (ors.`id_order_slip` = orr.`id_return_type` AND orr.`return_type` = '.(int) self::RETURN_TYPE_ORDER_SLIP.')
WHERE orr.`id_customer` = '.(int)$customer_id.

View File

@@ -251,6 +251,7 @@ class AdminOrdersControllerCore extends AdminController
$this->access_where = ' WHERE hbd.id_hotel IN ('.implode(',', $acsHtls).')';
}
parent::__construct();
}
@@ -1729,6 +1730,10 @@ class AdminOrdersControllerCore extends AdminController
$bookingOrderRoomInfo['num_checkin_documents'] = HotelBookingDocument::getCountByIdHtlBooking($bookingOrderRoomInfo['id']);
}
$objHotelBookingDetail = new HotelBookingDetail();
$htlBookingDetail = $objHotelBookingDetail->getOrderCurrentDataByOrderId($order->id);
$isCancelledRoom = in_array(1, array_column($htlBookingDetail, 'is_cancelled'));
// hotel booking statuses
$htlOrderStatus = HotelBookingDetail::getAllHotelOrderStatus();
@@ -1826,6 +1831,7 @@ class AdminOrdersControllerCore extends AdminController
'products' => $products,
'customer' => $customer)
),
'isCancelledRoom' => $isCancelledRoom,
);
return parent::renderView();
@@ -3163,7 +3169,6 @@ class AdminOrdersControllerCore extends AdminController
// delete cart feature prices after room addition success
HotelRoomTypeFeaturePricing::deleteByIdCart($cart->id);
die(json_encode(array(
'result' => true,
//'view' => $this->createTemplate('_product_line.tpl')->fetch(),
@@ -3706,7 +3711,6 @@ class AdminOrdersControllerCore extends AdminController
}
$this->sendChangedNotification($order);
die(json_encode(array(
'result' => $res,
'view' => $view,
@@ -4007,31 +4011,19 @@ class AdminOrdersControllerCore extends AdminController
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
$additionlServicesTI = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$id_order,
$id_product,
$date_from,
$date_to,
$id_room,
$idHotelBooking,
1,
1
);
$additionlServicesTE = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$id_order,
$id_product,
$date_from,
$date_to,
$id_room,
$idHotelBooking,
1,
0
);
$selectedAdditonalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$id_order,
$id_product,
$date_from,
$date_to,
$id_room
$idHotelBooking
);
@@ -4142,7 +4134,7 @@ class AdminOrdersControllerCore extends AdminController
// delete the demands od this booking
$objBookingDemand->deleteBookingDemands($idHotelBooking);
$objRoomTypeServiceProductOrderDetail->deleteRoomSevicesByIdHotelBookingDetail($idHotelBooking);
$objRoomTypeServiceProductOrderDetail->deleteRoomSevices($idHotelBooking);
/*By webkul to delete cart and order entries from cart and order tables of hotelreservationsystem when delete booking form the order line in order detaoil page*/
$obj_htl_cart_booking = new HotelCartBookingData();
@@ -4162,7 +4154,6 @@ class AdminOrdersControllerCore extends AdminController
));
$this->sendChangedNotification($order);
die(json_encode(array(
'result' => $res,
'order' => $order,
@@ -4748,11 +4739,7 @@ class AdminOrdersControllerCore extends AdminController
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$idOrder,
$idProduct,
$dateFrom,
$dateTo,
$idRoom
$htlBookingDetail['id']
)) {
$smartyVars['additionalServices'] = $additionalServices;
}
@@ -4795,11 +4782,7 @@ class AdminOrdersControllerCore extends AdminController
$smartyVars['id_booking_detail'] = $htlBookingDetail['id'];
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$idOrder,
$idProduct,
$dateFrom,
$dateTo,
$idRoom
$htlBookingDetail['id']
)) {
$smartyVars['additionalServices'] = $additionalServices;
}

View File

@@ -242,7 +242,15 @@ class OrderDetailControllerCore extends FrontController
} else {
$hasError = 1;
}
$res = true;
if (!$hasError) {
if ((int)$order->total_paid_real == 0){
foreach ($bookingRefunds as $idHtlBooking) {
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
$objHtlBooking->save();
}
}
$objOrderReturn = new OrderReturn();
$objOrderReturn->id_customer = $order->id_customer;
$objOrderReturn->id_order = $order->id;
@@ -381,6 +389,13 @@ class OrderDetailControllerCore extends FrontController
if ($data_v['is_back_order']) {
$anyBackOrder = 1;
}
if ($data_v['is_refunded']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] += 1;
}
if ($data_v['is_cancelled']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] += 1;
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] -= 1;
}
} else {
$num_days = $objBookingDetail->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
$cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'] = 1;
@@ -400,8 +415,19 @@ class OrderDetailControllerCore extends FrontController
if ($data_v['is_back_order']) {
$anyBackOrder = 1;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] = 0;
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] = 0;
if ($data_v['is_refunded']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] += 1;
}
if ($data_v['is_cancelled']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] += 1;
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] -= 1;
}
}
$cartHotelData[$type_key]['date_diff'][$date_join]['is_refunded'] = $data_v['is_refunded'];
$cartHotelData[$type_key]['date_diff'][$date_join]['ids_htl_booking_detail'][] = $data_v['id'];
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
@@ -575,6 +601,9 @@ class OrderDetailControllerCore extends FrontController
$redirectTermsLink = $this->context->link->getCMSLink(new CMS(3, $this->context->language->id), null, $this->context->language->id);
}
$objHotelBookingDetail = new HotelBookingDetail();
$htlBookingDetail = $objHotelBookingDetail->getOrderCurrentDataByOrderId($order->id);
$this->context->smarty->assign(
array(
'id_cms_refund_policy' => Configuration::get('WK_GLOBAL_REFUND_POLICY_CMS'),
@@ -664,4 +693,4 @@ class OrderDetailControllerCore extends FrontController
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
}
}
}
}

View File

@@ -51,11 +51,17 @@ class OrderReturnControllerCore extends FrontController
$orderCurrency = new Currency($objOrder->id_currency);
$refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($objOrderReturn->id_order, $objOrderReturn->id, 0, 1);
$isCanceled = false;
if (count(array_unique(array_column($refundReqBookings, 'is_cancelled'))) === 1
&& array_unique(array_column($refundReqBookings, 'is_cancelled'))[0] != 0
) {
$isCanceled = true;
}
$this->context->smarty->assign(
array (
'orderReturnInfo' => (array)$objOrderReturn,
'refundReqBookings' => $refundReqBookings,
'isCanceled' => $isCanceled,
'orderInfo' => (array) $objOrder,
'orderCurrency' => (array) $orderCurrency,
'currentStateInfo' => (array) new OrderReturnState($objOrderReturn->state,

View File

@@ -906,4 +906,4 @@
<value>1</value>
</configuration>
</entities>
</entity_configuration>
</entity_configuration>

View File

@@ -44,6 +44,7 @@ class HotelBookingDetail extends ObjectModel
public $is_back_order;
public $id_status;
public $is_refunded;
public $is_cancelled;
// public $available_for_order;
// hotel information/location/contact
@@ -107,6 +108,7 @@ class HotelBookingDetail extends ObjectModel
'total_price_tax_incl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
'total_paid_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'default' => 0, 'required' => true),
'is_refunded' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'is_cancelled' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
// 'available_for_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'is_back_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),

View File

@@ -126,17 +126,16 @@ class HotelOrderRefundRules extends ObjectModel
return Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'htl_order_refund_rules` WHERE days='.$days);
}
public function calculateDeductionAmountFromRefundRules($idOrder, $idOrderReturn = 0, $idHtlBooking = 0)
public function getBookingCancellationDetails($idOrder, $idOrderReturn = 0, $idHtlBooking = 0)
{
$totalCancelationCharges = 0;
$bookingCancellations = array();
$objHtlRefundRules = new HotelBranchRefundRules();
$objHotelBookingDemands = new HotelBookingDemands();
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($bookingsToRefund = OrderReturn::getOrdersReturnDetail($idOrder, $idOrderReturn, $idHtlBooking)) {
foreach ($bookingsToRefund as $booking) {
$bookingCancellationCharge = 0;
$bookingCancellationDetail = array();
if (Validate::isLoadedObject($objHtlBooking = new HotelBookingDetail($booking['id_htl_booking']))) {
$objOrder = new Order($objHtlBooking->id_order);
@@ -153,17 +152,10 @@ class HotelOrderRefundRules extends ObjectModel
1
);
$totalServicesPrice = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$objHtlBooking->id_order,
0,
0,
$objHtlBooking->id_product,
$objHtlBooking->date_from,
$objHtlBooking->date_to,
$objHtlBooking->id_room,
$totalServicesPrice = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$objHtlBooking->id,
1,
1,
null
1
);
if ($refundRules = $objHtlRefundRules->getHotelRefundRules($objHtlBooking->id_hotel, 0, 1)) {
@@ -189,31 +181,34 @@ class HotelOrderRefundRules extends ObjectModel
} else {
$refundValue = $refRule['deduction_value_full_pay'];
}
$bookingCancellationDetail['reduction_value'] = $refundValue;
if ($refRule['payment_type'] == HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE) {
$bookingCancellationCharge = $paidAmount * ($refundValue / 100);
$bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE;
$bookingCancellationDetail['cancelation_charge'] = $paidAmount * ($refundValue / 100);
if ($defaultCurrency != $orderCurrency) {
$bookingCancellationCharge = Tools::convertPriceFull(
$bookingCancellationCharge,
$bookingCancellationDetail['cancelation_charge'] = Tools::convertPriceFull(
$bookingCancellationDetail['cancelation_charge'],
$objDefaultCurrency,
$objOrderCurrency
);
}
} else {
$bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_FIXED;
if ($defaultCurrency != $orderCurrency) {
$bookingCancellationCharge = Tools::convertPriceFull(
$bookingCancellationDetail['cancelation_charge'] = Tools::convertPriceFull(
$refundValue,
$objDefaultCurrency,
$objOrderCurrency
);
} else {
$bookingCancellationCharge = $refundValue;
$bookingCancellationDetail['cancelation_charge'] = $refundValue;
}
// if deduction amount is more than the order total cost
if ($bookingCancellationCharge > $paidAmount) {
$bookingCancellationCharge = $paidAmount;
if ($bookingCancellationDetail['cancelation_charge'] > $paidAmount) {
$bookingCancellationDetail['cancelation_charge'] = $paidAmount;
}
}
@@ -223,18 +218,22 @@ class HotelOrderRefundRules extends ObjectModel
}
if (!$ruleApplied) {
$bookingCancellationCharge = ($objHtlBooking->total_price_tax_incl + $totalDemandsPrice);
$bookingCancellationDetail['cancelation_charge'] = ($objHtlBooking->total_price_tax_incl + $totalDemandsPrice);
$bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE;
$bookingCancellationDetail['reduction_value'] = 100;
}
} else {
$bookingCancellationCharge = ($objHtlBooking->total_price_tax_incl + $totalDemandsPrice);
$bookingCancellationDetail['cancelation_charge'] = ($objHtlBooking->total_price_tax_incl + $totalDemandsPrice);
$bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE;
$bookingCancellationDetail['reduction_value'] = 100;
}
}
$totalCancelationCharges += $bookingCancellationCharge;
$bookingCancellations[] = $bookingCancellationDetail;
}
}
return $totalCancelationCharges;
return $bookingCancellations;
}
public static function getApplicableRefundRules($idOrder)

View File

@@ -174,6 +174,7 @@ class HotelReservationSystemDb
`children` smallint(6) NOT NULL DEFAULT '0',
`child_ages` text NOT NULL,
`is_refunded` tinyint(1) NOT NULL DEFAULT '0',
`is_cancelled` tinyint(1) NOT NULL DEFAULT '0',
-- `available_for_order` tinyint(1) NOT NULL DEFAULT '0',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
@@ -561,4 +562,4 @@ class HotelReservationSystemDb
`'._DB_PREFIX_.'htl_access`'
);
}
}
}

View File

@@ -185,11 +185,7 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
}
public function getSelectedServicesForRoom(
$idOrder,
$roomTypeIdProduct,
$dateFrom,
$dateTo,
$idRoom,
$idHotelBookingDetail,
$getTotalPrice = 0,
$useTax = null
) {
@@ -204,9 +200,11 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
od.`product_auto_add`, od.`product_price_calculation_method`, od.`product_price_addition_type`';
}
$sql .= ' FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` rsod ON(rsod.`id_htl_booking_detail` = hbd.`id`)';
INNER JOIN `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` rsod ON(rsod.`id_htl_booking_detail` = hbd.`id`)';
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON(od.`id_order_detail` = rsod.`id_order_detail`)';
$sql .= ' WHERE rsod.`id_order` = '.(int)$idOrder.' AND hbd.`id_product`='.(int) $roomTypeIdProduct .' AND hbd.`date_from` = \''.pSQL($dateFrom).'\' AND hbd.`date_to` = \''.pSQL($dateTo).'\' AND hbd.`id_room`='.(int) $idRoom;
$sql .= ' WHERE hbd.`id` = '.(int)$idHotelBookingDetail;
if ($getTotalPrice) {
$totalPrice = 0;
@@ -274,7 +272,7 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
return $selectedAdditionalServices;
}
public function deleteRoomSevicesByIdHotelBookingDetail($idHotelBookingDetail)
public function deleteRoomSevices($idHotelBookingDetail)
{
$services = Db::getInstance()->executeS(
'SELECT `id_room_type_service_product_order_detail` FROM `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` pod

View File

@@ -220,11 +220,12 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
$objRefundRules = new HotelOrderRefundRules();
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($objOrderReturn->id_order, $objOrderReturn->id)){
foreach ($refundReqBookings as &$booking) {
$booking['cancelation_charge'] = $objRefundRules->calculateDeductionAmountFromRefundRules(
$bookingCharges = $objRefundRules->getBookingCancellationDetails(
$objOrderReturn->id_order,
$objOrderReturn->id,
$booking['id']
);
$booking = array_merge($booking, array_shift($bookingCharges));
}
}
@@ -279,8 +280,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
if (Validate::isLoadedObject($objRefundState = new OrderReturnState($idRefundState))) {
if ($objRefundState->refunded) {
$refundedAmounts = Tools::getValue('refund_amounts');
if ((float) $orderTotalPaid) {
if ((float) $orderTotalPaid > 0) {
if ($idsReturnDetail && count($idsReturnDetail)) {
if ($refundedAmounts) {
foreach ($idsReturnDetail as $idRetDetail) {
@@ -327,6 +327,8 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
$totalRefundedAmount = 0;
if ($objRefundState->refunded || $objRefundState->denied) {
$objHotelBookingDemands = new HotelBookingDemands();
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
foreach ($idsReturnDetail as $idRetDetail) {
$objOrderReturnDetail = new OrderReturnDetail($idRetDetail);
@@ -334,24 +336,75 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
$idHtlBooking = $objOrderReturnDetail->id_htl_booking;
$numDays = 1;
$idOrderDetail = 0;
$reduction_amount = array(
'total_price_tax_excl' => 0,
'total_price_tax_incl' => 0,
'total_products_tax_excl' => 0,
'total_products_tax_incl' => 0,
);
if (Validate::isLoadedObject($objHtlBooking = new HotelBookingDetail($idHtlBooking))) {
$objHtlBooking->is_refunded = 1;
// if (Tools::isSubmit('unavailable_for_order')) {
// $objHtlBooking->available_for_order = 0;
// } else {
// $objHtlBooking->available_for_order = 1;
// }
$objHtlBooking->is_refunded = 1;
$objHtlBooking->save();
$numDays = $objHtlBooking->getNumberOfDays(
$objHtlBooking->date_from,
$objHtlBooking->date_to
);
if ((float) $orderTotalPaid <= 0) {
$reduction_amount['total_price_tax_excl'] = $objHtlBooking->total_price_tax_excl;
$reduction_amount['total_products_tax_excl'] = $objHtlBooking->total_price_tax_excl;
$reduction_amount['total_price_tax_incl'] = $objHtlBooking->total_price_tax_incl;
$reduction_amount['total_products_tax_incl'] = $objHtlBooking->total_price_tax_incl;
// reduce facilities amount from order and services_detail
if ($roomDemands = $objHotelBookingDemands->getRoomTypeBookingExtraDemands(
$objHtlBooking->id_order,
$objHtlBooking->id_product,
$objHtlBooking->id_room,
$objHtlBooking->date_from,
$objHtlBooking->date_to,
0
)) {
foreach ($roomDemands as $roomDemand) {
$objHotelBookingDemands = new HotelBookingDemands($roomDemand['id_booking_demand']);
$reduction_amount['total_price_tax_excl'] += $objHotelBookingDemands->total_price_tax_excl;
$reduction_amount['total_price_tax_incl'] += $objHotelBookingDemands->total_price_tax_incl;
$objHotelBookingDemands->total_price_tax_excl = 0;
$objHotelBookingDemands->total_price_tax_incl = 0;
$objHotelBookingDemands->save();
}
}
// reduce services amount from order and services_detail
if ($roomServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$objHtlBooking->id
)) {
foreach ($roomServices['additional_services'] as $roomService) {
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail(
$roomService['id_room_type_service_product_order_detail']
);
$reduction_amount['total_price_tax_excl'] += $objRoomTypeServiceProductOrderDetail->total_price_tax_excl;
$reduction_amount['total_products_tax_excl'] += $objRoomTypeServiceProductOrderDetail->total_price_tax_excl;
$reduction_amount['total_price_tax_incl'] += $objRoomTypeServiceProductOrderDetail->total_price_tax_incl;
$reduction_amount['total_products_tax_incl'] += $objRoomTypeServiceProductOrderDetail->total_price_tax_incl;
if (Validate::isLoadedObject($objOrderDetail = new OrderDetail($objRoomTypeServiceProductOrderDetail->id_order_detail))) {
$objOrderDetail->product_quantity_refunded += $objRoomTypeServiceProductOrderDetail->quantity;
if ($objOrderDetail->product_quantity_refunded > $objOrderDetail->product_quantity) {
$objOrderDetail->product_quantity_refunded = $objOrderDetail->product_quantity;
}
$objOrderDetail->total_price_tax_excl -= $objRoomTypeServiceProductOrderDetail->total_price_tax_excl;
$objOrderDetail->total_price_tax_incl -= $objRoomTypeServiceProductOrderDetail->total_price_tax_incl;
$objOrderDetail->save();
}
$objRoomTypeServiceProductOrderDetail->total_price_tax_excl = 0;
$objRoomTypeServiceProductOrderDetail->total_price_tax_incl = 0;
$objRoomTypeServiceProductOrderDetail->save();
}
}
}
// enter refunded quantity in the order detail table
$idOrderDetail = $objHtlBooking->id_order_detail;
if (Validate::isLoadedObject($objOrderDetail = new OrderDetail($idOrderDetail))) {
@@ -359,8 +412,29 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
if ($objOrderDetail->product_quantity_refunded > $objOrderDetail->product_quantity) {
$objOrderDetail->product_quantity_refunded = $objOrderDetail->product_quantity;
}
if ((float) $orderTotalPaid <= 0) {
// reduce room amount from order and order detail
$objOrderDetail->total_price_tax_incl -= $objHtlBooking->total_price_tax_incl;
$objOrderDetail->total_price_tax_excl -= $objHtlBooking->total_price_tax_excl;
if (Validate::isLoadedObject($objOrder = new Order($objHtlBooking->id_order))) {
$objOrder->total_paid -= $reduction_amount['total_price_tax_incl'];
$objOrder->total_paid_tax_excl -= $reduction_amount['total_price_tax_excl'];
$objOrder->total_paid_tax_incl -= $reduction_amount['total_price_tax_incl'];
$objOrder->total_products -= $reduction_amount['total_products_tax_excl'];
$objOrder->total_products_wt -= $reduction_amount['total_products_tax_incl'];
$objOrder->save();
}
}
$objOrderDetail->save();
}
if ((float) $orderTotalPaid <= 0) {
// reduce room amount from htl_booking_detail
$objHtlBooking->is_cancelled = 1;
$objHtlBooking->total_price_tax_excl = 0;
$objHtlBooking->total_price_tax_incl = 0;
}
$objHtlBooking->save();
}
// save individual booking amount for every booking refund
@@ -387,7 +461,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
}
// if bookings are refunded then set the payment information
if ($objRefundState->refunded) {
if ($objRefundState->refunded && (float) $orderTotalPaid > 0) {
if (Tools::isSubmit('refundTransactionAmount')) {
$objOrderReturn->payment_mode = $paymentMode;
$objOrderReturn->id_transaction = $idTransaction;

View File

@@ -52,7 +52,8 @@ class AdminOrderRefundRulesController extends ModuleAdminController
);
$paymentType = array(
HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE => 'Percentage', HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_FIXED => 'Fixed'
HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE => 'Percentage',
HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_FIXED => 'Fixed'
);
$this->fields_list = array(
@@ -316,4 +317,4 @@ class AdminOrderRefundRulesController extends ModuleAdminController
$this->addJs(_MODULE_DIR_.$this->module->name.'/views/js/admin/wk_refund_rule.js');
$this->addJS(_MODULE_DIR_.$this->module->name.'/views/js/HotelReservationAdmin.js');
}
}
}

View File

@@ -118,8 +118,9 @@
<th>{l s='Room type' mod='hotelreservationsystem'}</th>
<th>{l s='Hotel' mod='hotelreservationsystem'}</th>
<th>{l s='Duration' mod='hotelreservationsystem'}</th>
<th>{l s='Total rooms paid (tax incl.)'}</th>
<th>{l s='Additional services price (tax incl.)'}</th>
<th>{l s='Total room cost (tax incl.)'}</th>
<th>{l s='Room amount paid (tax incl.)'}</th>
<th>{l s='Additional services amount paid (tax incl.)'}</th>
{if !$isRefundCompleted}
<th>{l s='Rooms cancelation charges' mod='hotelreservationsystem'}</th>
{/if}
@@ -136,10 +137,16 @@
<td>{$booking['room_type_name']|escape:'htmlall':'UTF-8'}</td>
<td>{$booking['hotel_name']|escape:'htmlall':'UTF-8'}</td>
<td>{$booking['date_from']|date_format:"%d-%m-%Y"} {l s='To' mod='hotelreservationsystem'} {$booking['date_to']|date_format:"%d-%m-%Y"}</td>
<td>{displayPrice price=$booking['total_paid_amount'] currency=$orderCurrency['id']}</td>
<td>{displayPrice price=($booking['extra_demands_price_tax_incl'] + $booking['additional_services_tax_incl']) currency=$orderCurrency['id']}</td>
<td>{displayPrice price=$booking['total_price_tax_incl'] currency=$orderCurrency['id']}</td>
<td>{displayPrice price=$booking['room_paid_amount'] currency=$orderCurrency['id']}</td>
<td>{displayPrice price=$booking['extra_service_total_paid_amount'] currency=$orderCurrency['id']}</td>
{if !$isRefundCompleted}
<td>{displayPrice price=$booking['cancelation_charge'] currency=$orderCurrency['id']}</td>
<td>
{displayPrice price=$booking['cancelation_charge'] currency=$orderCurrency['id']}
{if $booking['reduction_type'] == HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE}
<p class="help-block">{Tools::ps_round($booking['reduction_value'])}{l s='% of'} {displayPrice price=$booking['total_price_tax_incl'] currency=$orderCurrency['id']}</p>
{/if}
</td>
{/if}
{if $orderTotalPaid|floatval}
<td>
@@ -148,7 +155,7 @@
{displayPrice price=$booking['refunded_amount'] currency=$orderCurrency['id']}
{else}
<span class="input-group-addon">{$orderCurrency['sign']|escape:'html':'UTF-8'}</span>
<input placeholder="" type="text" name="refund_amounts[{$booking['id_order_return_detail']|escape:'html':'UTF-8'}]" value="{$booking['total_paid_amount'] - $booking['cancelation_charge']}">
<input placeholder="" type="text" name="refund_amounts[{$booking['id_order_return_detail']|escape:'html':'UTF-8'}]" value="{$booking['room_paid_amount'] + $booking['extra_service_total_paid_amount'] - $booking['cancelation_charge']}">
<span class="input-group-addon">{l s='tax incl.' mod='hotelreservationsystem'}</span>
{/if}
</div>
@@ -229,7 +236,7 @@
<div class="col-sm-3">
<select id="id_refund_state" name="id_refund_state">
{foreach from=$refundStatuses item=state}
<option refunded="{$state['refunded']|escape:'html':'UTF-8'}" denied="{$state['denied']|escape:'html':'UTF-8'}" value="{$state['id_order_return_state']|intval}"{if isset($currentStateInfo) && $state['id_order_return_state'] == $currentStateInfo['id']} selected="selected" disabled="disabled"{/if}>{$state['name']|escape:'html':'UTF-8'}</option>
<option refunded="{$state['refunded']|escape:'html':'UTF-8'}" denied="{$state['denied']|escape:'html':'UTF-8'}" value="{$state['id_order_return_state']|intval}"{if isset($currentStateInfo) && $state['id_order_return_state'] == $currentStateInfo['id']} selected="selected"{/if}>{$state['name']|escape:'html':'UTF-8'}</option>
{/foreach}
</select>
</div>
@@ -330,4 +337,4 @@
</form>
</div>
</div>
</div>
</div>

File diff suppressed because it is too large Load Diff

View File

@@ -61,7 +61,13 @@
{$return.total_rooms|escape:'html':'UTF-8'}
</td>
<td>
<span class="badge wk-badge" style="background-color:{$return.state_color|escape:'html':'UTF-8'}">{$return.state_name|escape:'html':'UTF-8'}</span>
<span class="badge wk-badge" style="background-color:{$return.state_color|escape:'html':'UTF-8'}">
{if $return.is_cancelled}
{l s='Cancelled'}
{else}
{$return.state_name|escape:'html':'UTF-8'}
{/if}
</span>
</td>
<td>
{dateFormat date=$return.date_add full=0}

View File

@@ -54,7 +54,7 @@
<th>{l s='Duration'}</th>
<th>{l s='Num rooms'}</th>
<th>{l s='Total rooms price (tax incl.)'}</th>
<th>{l s='Additional facilities price (tax incl.)'}</th>
<th>{l s='Extra services price (tax incl.)'}</th>
{if $isRefundCompleted}
<th>{l s='Refund amount'}</th>
{/if}
@@ -67,7 +67,7 @@
<td>{$booking['date_from']|date_format:"%d-%m-%Y"} {l s='To'} {$booking['date_to']|date_format:"%d-%m-%Y"}</td>
<td>{$booking['num_rooms']|escape:'htmlall':'UTF-8'}</td>
<td>{displayPrice price=$booking['total_price_tax_incl'] currency=$orderCurrency['id']}</td>
<td>{displayPrice price=$booking['extra_demands_price_tax_incl'] currency=$orderCurrency['id']}</td>
<td>{displayPrice price=$booking['extra_service_total_price_tax_incl'] currency=$orderCurrency['id']}</td>
{if $isRefundCompleted}
<td>
{displayPrice price=$booking['refunded_amount'] currency=$orderCurrency['id']}
@@ -83,7 +83,13 @@
<strong>{l s='Current refund state'} </strong>
</div>
<div class="col-sm-9 col-md-10">
<span class="badge wk-badge" style="background-color:{$currentStateInfo['color']|escape:'html':'UTF-8'}">{$currentStateInfo['name']|escape:'html':'UTF-8'}</span>
<span class="badge wk-badge" style="background-color:{$currentStateInfo['color']|escape:'html':'UTF-8'}">
{if $isCanceled}
{l s='Cancelled'}
{else}
{$currentStateInfo['name']|escape:'html':'UTF-8'}
{/if}
</span>
</div>
</div>
<div class="form-group row">
@@ -120,26 +126,53 @@
{displayPrice price=$orderReturnInfo['refunded_amount'] currency=$orderInfo['id_currency']}
</div>
</div>
<div class="form-group row">
<div class="col-md-2 col-sm-3">
<strong>{l s='Payment mode' mod='hotelreservationsystem'}</strong>
{if $orderReturnInfo['payment_mode'] != '' && $orderReturnInfo['id_transaction'] != ''}
<div class="form-group row">
<div class="col-md-2 col-sm-3">
<strong>{l s='Payment mode' mod='hotelreservationsystem'}</strong>
</div>
<div class="col-sm-9 col-md-10">
{$orderReturnInfo['payment_mode']|escape:'html':'UTF-8'}
</div>
</div>
<div class="col-sm-9 col-md-10">
{$orderReturnInfo['payment_mode']|escape:'html':'UTF-8'}
<div class="form-group row">
<div class="col-md-2 col-sm-3">
<strong>{l s='Transaction ID' mod='hotelreservationsystem'}</strong>
</div>
<div class="col-sm-9 col-md-10">
{$orderReturnInfo['id_transaction']|escape:'html':'UTF-8'}
</div>
</div>
</div>
<div class="form-group row">
<div class="col-md-2 col-sm-3">
<strong>{l s='Transaction ID' mod='hotelreservationsystem'}</strong>
</div>
<div class="col-sm-9 col-md-10">
{$orderReturnInfo['id_transaction']|escape:'html':'UTF-8'}
</div>
</div>
{/if}
{if isset($orderReturnInfo['return_type'])}
{if $orderReturnInfo['return_type'] == OrderReturn::RETURN_TYPE_CART_RULE}
<div class="form-group row">
<div class="col-md-2 col-sm-3">
<strong>{l s='Voucher ID:' mod='hotelreservationsystem'}</strong>
</div>
<div class="col-sm-9 col-md-10">
<a class="btn btn-default btn-sm" href="{$link->getPageLink('discount')}" target="_blank">
{l s='View your vouchers'}
</a>
</div>
</div>
{elseif $orderReturnInfo['return_type'] == OrderReturn::RETURN_TYPE_ORDER_SLIP}
<div class="form-group row">
<div class="col-md-2 col-sm-3">
<strong>{l s='Credit Slip:' mod='hotelreservationsystem'}</strong>
</div>
<div class="col-sm-9 col-md-10">
<a class="btn btn-default btn-sm" href="{$link->getPageLink('order-slip')}">
{l s='View your creadit slips' mod='hotelreservationsystem'}
</a>
</div>
</div>
{/if}
{/if}
{/if}
</div>
<ul class="footer_links clearfix">
<li><a class="btn btn-default button button-small" href="{$link->getPageLink('my-account', true)|escape:'html':'UTF-8'}"><span><i class="icon-chevron-left"></i> {l s='Back to your account'}</span></a></li>
<li><a class="btn btn-default button button-small" href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}"><span><i class="icon-chevron-left"></i> {l s='Home'}</span></a></li>
</ul>
</ul>