Merge branch 'develop' into gli-1739

This commit is contained in:
vishalsingh.qlo325
2024-08-16 16:42:44 +05:30
34 changed files with 973 additions and 595 deletions

View File

@@ -16,6 +16,7 @@ $kpi-gap: 10px
flex-wrap: wrap
margin-left: -($kpi-gap / 2)
margin-right: -($kpi-gap / 2)
flex-grow: 1
.kpi-wrap
display: inline-block
width: 20%

View File

@@ -65,7 +65,7 @@
margin-bottom: 0 !important
#addressInvoice
width: 49% !important
float: right !important
float: right !important
margin-bottom: 0 !important
#status
tr:first-child td
@@ -81,15 +81,14 @@
i
display: none !important
.kpi-container.panel
margin: 30px 0 20px 0 !important
border: solid 1px black !important
.actions-wrap
display: none
.box-stats
padding: 10px 0 !important
height: auto !important
width: 25% !important
font-size: 8pt !important
i
font-size: 20pt !important
span.arrow
display: none
.alert
border: 1px solid black !important
&:before
@@ -99,3 +98,38 @@
margin: 0 !important
.panel-total td
font-size: 13pt!important
#customer_cart_details
thead
display: none
tr
display: block
border: 1px solid #ccc
-webkit-box-shadow: #EAEDEF 0 2px 0 0
box-shadow: #EAEDEF 0 2px 0 0
width: 100%
margin-bottom: 6px
td
display: block
display: grid
grid-template-columns: 2fr 3fr
text-align: center !important
position: relative
width: 100% !important
text-align: left !important
line-height: 2em !important
font-size: 1.15em !important
white-space: nowrap
overflow: hidden
text-overflow: ellipsis
> span
padding: 0px 5px
> span:nth-child(1)
border-right: 1px solid #EAEDEF
padding-right: 10px
white-space: nowrap
color: #aaa
text-align: right
font-size: .9em
font-style: italic

View File

@@ -0,0 +1,83 @@
{*
* Since 2010 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through this link for complete license : https://store.webkul.com/license.html
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
*
* @author Webkul IN <support@webkul.com>
* @copyright Since 2010 Webkul IN
* @license https://store.webkul.com/license.html
*}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><i class="icon-remove-sign"></i></button>
<h4 class="modal-title"><i class="icon icon-exclamation-triangle"></i>&nbsp;{l s='Confirm Delete'}</h4>
{if isset($cartRules)}
<p>{l s='The following cart rules in your selection were created dynamically from refunds or credit slips. Please confirm if you also intend to delete these cart rules?'}</p>
{else}
<p>{l s='Are you sure, you want to delete the selected cart rules?'}</p>
{/if}
</div>
{if isset($cartRules)}
<div class="modal-body">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>
</th>
<th>
{l s='Cart Rule'}
</th>
<th>
{l s='Reason'}
</th>
<th>
{l s='Order'}
</th>
<th>
{l s='Amount'}
</th>
</tr>
</thead>
{foreach $cartRules as $cartRule}
<tr>
<td>
<input type="checkbox" class="cart_rule_to_delete" value="{$cartRule['id_cart_rule']}" checked>
</td>
<td>
<a href="{$link->getAdminLink('AdminCartRules')}&updatecart_rule&id_cart_rule={$cartRule['id_cart_rule']}" target="_blank">#{$cartRule['id_cart_rule']}</a>
</td>
<td>
{if $cartRule['generated_by'] == CartRule::GENERATED_BY_REFUND}
<b>{l s='Generated against refund'}</b>
(<a href="{$link->getAdminLink('AdminOrderRefundRequests')}&vieworder_return&id_order_return={$cartRule['id_generated_by']}" target="_blank">#{$cartRule['id_generated_by']}</a>)
{else if $cartRule['generated_by'] == CartRule::GENERATED_BY_ORDER_SLIP}
<b>{l s='Generated against credit slip'}</b>
(<a href="{$link->getAdminLink('AdminPdf')}&submitAction=generateOrderSlipPDF&id_order_slip={$cartRule['id_generated_by']}" target="_blank">#{$cartRule['id_generated_by']}</a>)
{/if}
{if !$cartRule['cart_rule']->quantity}
<span class="badge badge-danger">{l s='Used'}</span>
{/if}
</td>
<td>
<a href="{$link->getAdminLink('AdminOrders')}&vieworder&id_order={$cartRule['order']->id}" target="_blank">#{$cartRule['order']->id}</a>
</td>
<td>
{displayPrice price=$cartRule['cart_rule']->reduction_amount currency=$cartRule['cart_rule']->reduction_currency}
</td>
</tr>
{/foreach}
</table>
</div>
</div>
{/if}

View File

@@ -0,0 +1,71 @@
{*
* Since 2010 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through this link for complete license : https://store.webkul.com/license.html
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
*
* @author Webkul IN <support@webkul.com>
* @copyright Since 2010 Webkul IN
* @license https://store.webkul.com/license.html
*}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><i class="icon-remove-sign"></i></button>
<h4 class="modal-title"><i class="icon icon-exclamation-triangle"></i> {l s='Confirm Delete'}</h4>
<p>{l s='Are you sure, you want to delete this cart rule?'}</p>
</div>
{if isset($cartRule)}
<div class="modal-body">
<div class="row">
<div class="col-sm-4">
<label>{l s='Voucher'}</label>
<p class="control-value">
{$cartRule->code} (<a href="{$link->getAdminLink('AdminCartRules')}&updatecart_rule&id_cart_rule={$cartRule->id}" target="_blank">#{$cartRule->id}</a>)
</p>
</div>
<div class="col-sm-4">
<label>{l s='Reason'}</label>
<p class="control-value">
{if $generatedBy == CartRule::GENERATED_BY_REFUND}
{l s='Generated against refund'}
(<a href="{$link->getAdminLink('AdminOrderRefundRequests')}&vieworder_return&id_order_return={$generatedById}" target="_blank">#{$generatedById}</a>)
{else if $generatedBy == CartRule::GENERATED_BY_ORDER_SLIP}
{l s='Generated against credit slip'}
(<a href="{$link->getAdminLink('AdminPdf')}&submitAction=generateOrderSlipPDF&id_order_slip={$generatedById}" target="_blank">#{$generatedById}</a>)
{/if}
</p>
</div>
<div class="col-sm-4">
<label>{l s='Amount'}</label>
<p class="control-value">{displayPrice price=$cartRule->reduction_amount currency=$cartRule->reduction_currency}</p>
</div>
<div class="col-sm-4">
<label>{l s='Customer'}</label>
<p class="control-value">
{$customer->firstname} {$customer->lastname} (<a href="{$link->getAdminLink('AdminCustomers')}&viewcustomer&id_customer={$customer->id}" target="_blank">#{$customer->id}</a>)
</p>
</div>
<div class="col-sm-4">
<label>{l s='Order'}</label>
<p class="control-value">
{$order->reference} (<a href="{$link->getAdminLink('AdminOrders')}&vieworder&id_order={$order->id}" target="_blank">#{$order->id}</a>)
</p>
</div>
{if !$cartRule->quantity}
<div class="col-sm-4">
<label>{l s='Status'}</label>
<p class="control-value">
<span class="badge badge-danger">{l s='Used'}</span>
</p>
</div>
{/if}
</div>
</div>
{/if}

View File

@@ -118,7 +118,7 @@
{assign var=shown_room_type_price value=$data.product_price_tax_excl}
{/if}
<div class="input-group">
<input type="text" class="room_unit_price" value="{$shown_room_type_price|escape:'html':'UTF-8'}">
<input type="text" class="room_unit_price" value="{Tools::ps_round($shown_room_type_price, $smarty.const._PS_PRICE_DISPLAY_PRECISION_)|escape:'html':'UTF-8'}">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
</div>
</td>

View File

@@ -42,7 +42,7 @@
<td>{dateFormat date=$data['date_from']} {l s='To'} {dateFormat date=$data['date_to']}</td>
<td>
{if $order->with_occupancy && $data['children']}
<div class="dropdown booking_occupancy_show">
<div class="dropdown">
<a data-toggle="dropdown">
<span>{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
</a>
@@ -62,7 +62,7 @@
</div>
</div>
{else}
<span class="booking_occupancy_show">{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
<span>{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
{/if}
</td>
<td>

View File

@@ -35,33 +35,11 @@
<p><a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&amp;id_product={$data.id_product}&amp;updateproduct" target="_blank"><span>{$data.room_type}</span></a></p>
</td>
<td>
<span class="booking_duration_show">{dateFormat date=$data.date_from} - {dateFormat date=$data.date_to}</span>
{if $can_edit}
<div class="booking_duration_edit" style="display:none;">
<div class="form-group">
<div class="fixed-width-xl room_check_in_div">
<div class="input-group">
<div class="input-group-addon">{l s='Check In'}</div>
<input type="text" class="form-control edit_product_date_from" name="edit_product[date_from]" value="{$data.date_from|date_format:"%d-%m-%Y"}" data-min_date="{$data.date_from|date_format:"%d-%m-%Y"}"/>
<div class="input-group-addon"><i class="icon-calendar"></i></div>
</div>
</div>
<br/>
<div class="fixed-width-xl room_check_out_div">
<div class="input-group">
<div class="input-group-addon">{l s='Check Out'}</div>
<input type="text" class="form-control edit_product_date_to" name="edit_product[date_to]" value="{$data.date_to|date_format:"%d-%m-%Y"}" data-min_date="{$data.date_from|date_format:"%d-%m-%Y"}"/>
<div class="input-group-addon"><i class="icon-calendar"></i></div>
</div>
</div>
</div>
</div>
{/if}
{dateFormat date=$data.date_from} - {dateFormat date=$data.date_to}
</td>
<td>
{if $data['children']}
<div class="dropdown booking_occupancy_show">
<div class="dropdown">
<a data-toggle="dropdown">
<span>{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
</a>
@@ -81,122 +59,31 @@
</div>
</div>
{else}
<span class="booking_occupancy_show">{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
{/if}
<div class="booking_occupancy_edit" style="display:none;">
<div class="dropdown">
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy" type="button">
<span>
{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
</span>
</button>
<div class="dropdown-menu booking_occupancy_wrapper fixed-width-xxl well well-sm">
<div class="booking_occupancy_inner row">
<div class="occupancy_info_block col-sm-12" occ_block_index="0">
<div class="row">
<div class="col-xs-6 form-group occupancy_count_block">
<div class="col-sm-12">
<label>{l s='Adults'}</label>
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="{$data['adults']}" min="1">
</div>
</div>
<div class="col-xs-6 form-group occupancy_count_block">
<div class="col-sm-12">
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="{$data['children']}" min="0">
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
</div>
</div>
</div>
<p style="display:none;"><span class="text-danger occupancy-input-errors"></span></p>
<div class="row children_age_info_block" {if !isset($data['child_ages']) || !$data['child_ages']}style="display:none"{/if}>
<div class="col-sm-12 form-group">
<label class="col-sm-12">{l s='All Children'}</label>
<div class="col-sm-12">
<div class="row children_ages">
{if isset($data['child_ages']) && $data['child_ages']}
{foreach $data['child_ages'] as $childAge}
<p class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<select class="guest_child_age room_occupancies" name="occupancy[0][child_ages][]">
<option value="-1" {if $childAge == -1}selected{/if}>{l s='Select 1'}</option>
<option value="0" {if $childAge == 0}selected{/if}>{l s='Under 1'}</option>
{for $age=1 to ($max_child_age-1)}
<option value="{$age|escape:'htmlall':'UTF-8'}" {if $childAge == $age}selected{/if}>{$age|escape:'htmlall':'UTF-8'}</option>
{/for}
</select>
</p>
{/foreach}
{/if}
</div>
</div>
</div>
</div>
<hr class="occupancy-info-separator col-sm-12">
<div class="col-sm-12">
<a class="pull-right close_occupancy_link" href="#">{l s='close'} <i class="icon-remove"></i></a>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
<td>
<span class="room_unit_price_show">
<p>
<span class="room_type_current_price">
{convertPriceWithCurrency price=$data['total_price_tax_excl'] currency=$currency->id}
</span>
</p>
<p class="help-block">{l s='Per day price:'} {convertPriceWithCurrency price=$data['paid_unit_price_tax_excl'] currency=$currency->id}</p>
</span>
<div class="room_unit_price_edit" style="display: none;">
<input class="form-control" type="text" class="room_unit_price" name="room_unit_price" value="{$data['paid_unit_price_tax_excl']}">
<p class="help-block">{l s='Set per day price'}</p>
</div>
<p>
<span class="room_type_current_price">
{convertPriceWithCurrency price=$data['total_price_tax_excl'] currency=$currency->id}
</span>
</p>
<p class="help-block">{l s='Per day price:'} {convertPriceWithCurrency price=$data['paid_unit_price_tax_excl'] currency=$currency->id}</p>
</td>
<td>
<span class="extra_service_show">
{convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id}
{if $data['extra_demands']|count || $data['additional_services']|count}
<a class="open_room_extra_services" href="#" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" id_htl_booking="{$data['id']}">
<i class="icon icon-lg icon-info-circle"></i>
</a>
{/if}
</span>
<span class="extra_service_edit" style="display: none;">
{convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id}
{if $data['extra_demands']|count || $data['additional_services']|count}
<a class="open_room_extra_services" href="#" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" id_htl_booking="{$data['id']}">
{convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id}
<i class="icon icon-lg icon-info-circle"></i>
</a>
</span>
</td>
<td>
<span class="product_price_show">{convertPriceWithCurrency price=($data['total_room_tax']) currency=$currency->id}</span>
</td>
<td>
<span class="product_price_show">{convertPriceWithCurrency price=($data['total_room_price_ti']) currency=$currency->id}</span>
{if $can_edit}
<div class="product_price_edit" style="display:none;">
<div class="form-group">
<div class="fixed-width-xl">
<div class="input-group">
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
<input type="text" name="product_price_tax_excl" class="edit_product_price_tax_excl edit_product_price" value="{Tools::ps_round($data.original_unit_price_tax_excl, 2)}"/>
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
</div>
</div>
<br/>
<div class="fixed-width-xl">
<div class="input-group">
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
<input type="text" name="product_price_tax_incl" class="edit_product_price_tax_incl edit_product_price" value="{Tools::ps_round($data.original_unit_price_tax_incl, 2)}"/>
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
</div>
</div>
</div>
</div>
{/if}
</td>
<td>
{convertPriceWithCurrency price=($data['total_room_tax']) currency=$currency->id}
</td>
<td>
{convertPriceWithCurrency price=($data['total_room_price_ti']) currency=$currency->id}
</td>
{if (isset($refundReqBookings) && $refundReqBookings)}
<td>
{if $data.id|in_array:$refundReqBookings}
@@ -220,19 +107,6 @@
</td>
{/if}
{if ($can_edit && !$order->hasBeenDelivered())}
<td class="product_invoice" style="display: none;">
{if sizeof($invoices_collection)}
<select name="product_invoice" class="edit_product_invoice">
{foreach from=$invoices_collection item=invoice}
<option value="{$invoice->id}">
#{Configuration::get('PS_INVOICE_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$invoice->number}
</option>
{/foreach}
</select>
{else}
&nbsp;
{/if}
</td>
<td class="product_action">
<div class="btn-group">
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_cancelled}

View File

@@ -275,7 +275,7 @@
id_room: parseInt($(cart_row).attr('data-id-room')),
date_from: $(cart_row).attr('data-date-from'),
date_to: $(cart_row).attr('data-date-to'),
price: new Number($(this).val().replace(",",".")).toFixed(4).toString(),
price: new Number($(this).val().replace(",",".")).toString(),
id_cart: id_cart
};
updateProductPrice(params, cart_row);
@@ -667,6 +667,8 @@
tab: "AdminCarts",
action: "updateProductPrice",
params: params,
id_cart: id_cart,
id_customer: id_customer
},
success : function(response) {
updateCartLine(response.curr_booking_info, cart_row);

View File

@@ -855,6 +855,8 @@
{assign var=room_price_tax_incl value=$order->getTotalProductsWithTaxes(false, true)}
{assign var=service_products_price_tax_excl value=$order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE)}
{assign var=service_products_price_tax_incl value=$order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE)}
{assign var=convenience_fee_price_tax_excl value=$order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT)}
{assign var=convenience_fee_price_tax_incl value=$order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT)}
{assign var=additional_service_price_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $totalDemandsPriceTE)}
{assign var=additional_service_price_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $totalDemandsPriceTI)}
{if $room_price_tax_excl}
@@ -870,7 +872,7 @@
<tr id="total_products">
<td class="text-right">{l s='Total Extra services (Tax excl.)'}</td>
<td class="amount text-right nowrap">
{displayPrice price=($additional_service_price_tax_excl - $totalConvenienceFeeTE) currency=$currency->id}
{displayPrice price=($additional_service_price_tax_excl - $convenience_fee_price_tax_excl) currency=$currency->id}
</td>
<td class="partial_refund_fields current-edit" style="display:none;"></td>
</tr>
@@ -885,11 +887,11 @@
</tr>
{/if}
{if isset($totalConvenienceFeeTE) && $totalConvenienceFeeTE > 0}
{if isset($convenience_fee_price_tax_excl) && $convenience_fee_price_tax_excl > 0}
<tr id="total_products">
<td class="text-right">{l s='Convenience Fee (Tax excl.)'}</td>
<td class="amount text-right nowrap">
{displayPrice price=$totalConvenienceFeeTE currency=$currency->id}
{displayPrice price=$convenience_fee_price_tax_excl currency=$currency->id}
</td>
<td class="partial_refund_fields current-edit" style="display:none;"></td>
</tr>
@@ -908,16 +910,16 @@
<tr id="total_tax_order">
<td class="text-right">{l s='Extra services Tax'}</td>
<td class="text-right nowrap">
{displayPrice price=(($additional_service_price_tax_incl - $additional_service_price_tax_excl) - ($totalConvenienceFeeTI - $totalConvenienceFeeTE)) currency=$currency->id}
{displayPrice price=(($additional_service_price_tax_incl - $additional_service_price_tax_excl) - ($convenience_fee_price_tax_incl - $convenience_fee_price_tax_excl)) currency=$currency->id}
</td>
<td class="partial_refund_fields current-edit" style="display:none;"></td>
</tr>
{/if}
{if isset($totalConvenienceFeeTE) && $totalConvenienceFeeTE > 0}
{if isset($convenience_fee_price_tax_excl) && $convenience_fee_price_tax_excl > 0}
<tr id="total_products">
<td class="text-right">{l s='Convenience Fee Tax'}</td>
<td class="amount text-right nowrap">
{displayPrice price=($totalConvenienceFeeTI - $totalConvenienceFeeTE) currency=$currency->id}
{displayPrice price=($convenience_fee_price_tax_incl - $convenience_fee_price_tax_excl) currency=$currency->id}
</td>
<td class="partial_refund_fields current-edit" style="display:none;"></td>
</tr>
@@ -1098,13 +1100,13 @@
</div>
{/if}
<div class="col-lg-4 col-sm-6 col-xs-12">
<div class="col-lg-4 col-sm-6 col-xs-12 hidden-print">
<div class="panel">
<div class="panel-heading">
<i class="icon-envelope"></i> &nbsp;{l s='Messages'} <span class="badge">{sizeof($customer_thread_message)}</span>
<a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'html':'UTF-8'}&amp;id_order={$order->id|intval}" class="pull-right">{l s='Show all messages'}</a>
</div>
<div id="messages" class="hidden-print">
<div id="messages">
<form action="{$smarty.server.REQUEST_URI|escape:'html':'UTF-8'}&amp;token={$smarty.get.token|escape:'html':'UTF-8'}" method="post" onsubmit="if (getE('visibility').checked == true) return confirm('{l s='Do you want to send this message to the customer?'}');">
<div id="message" class="form-horizontal">
<div class="form-group">

View File

@@ -17,7 +17,7 @@
* @license LICENSE.txt
*}
<a href="{$status_change_link|escape:'html':'UTF-8'}" title="{l s='Change Status'}">
<a href="{$status_change_link|escape:'html':'UTF-8'}" title="{l s='Change Status'}" class="change_status">
<i class="icon-refresh"></i>
{l s='Change Status'}
</a>

View File

@@ -0,0 +1,49 @@
{*
* Since 2010 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through this link for complete license : https://store.webkul.com/license.html
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
*
* @author Webkul IN <support@webkul.com>
* @copyright Since 2010 Webkul IN
* @license https://store.webkul.com/license.html
*}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><i class="icon-remove-sign"></i></button>
<h4 class="modal-title"><i class="icon icon-exclamation-triangle"></i>&nbsp;{l s='Confirm Update'}</h4>
<p>{l s='This action is irreversable, Are you sure you want to change the status?'}</p>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<label>{l s='Credit Slip'}</label>
<p class="control-value">
<a href="{$link->getAdminLink('AdminCartRules')}&updatecart_rule&id_cart_rule={$orderSlip->id}" target="_blank">#{$orderSlip->id}</a>
</p>
</div>
<div class="col-sm-6">
<label>{l s='Amount'}</label>
<p class="control-value">{displayPrice price=$orderSlip->amount currency=$order->id_currency}</p>
</div>
<div class="col-sm-6">
<label>{l s='Customer'}</label>
<p class="control-value">
{$customer->firstname} {$customer->lastname} (<a href="{$link->getAdminLink('AdminCustomers')}&viewcustomer&id_customer={$customer->id}" target="_blank">#{$customer->id}</a>)
</p>
</div>
<div class="col-sm-6">
<label>{l s='Order'}</label>
<p class="control-value">
{$order->reference} (<a href="{$link->getAdminLink('AdminOrders')}&vieworder&id_order={$order->id}" target="_blank">#{$order->id}</a>)
</p>
</div>
</div>
</div>

View File

@@ -26,10 +26,10 @@
<div class="modal-dialog {if isset($modal_class)}{$modal_class}{/if}">
<div class="modal-content">
{if isset($modal_title)}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><i class="icon-remove-sign"></i></button>
<h4 class="modal-title">{$modal_title}</h4>
</div>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><i class="icon-remove-sign"></i></button>
<h4 class="modal-title">{$modal_title}</h4>
</div>
{/if}
{$modal_content}

View File

@@ -72,6 +72,9 @@ class CartRuleCore extends ObjectModel
public $date_add;
public $date_upd;
const GENERATED_BY_REFUND = 1;
const GENERATED_BY_ORDER_SLIP = 2;
/**
* @see ObjectModel::$definition
*/
@@ -909,7 +912,7 @@ class CartRuleCore extends ObjectModel
$reduction_value = 0;
$objHotelAdvancePayment = new HotelAdvancedPayment();
$cache_id = 'getContextualValue_'.(int)$this->id.'_'.(int)$use_tax.'_'.(int)$context->cart->id.'_'.(int)$filter.'_'.(int)$only_advance_payment_products;
$cache_id = 'getContextualValue_'.(int)$this->id.'_'.(int)$use_tax.'_'.(int)$context->cart->id.'_'.(int)$context->currency->id.'_'.(int)$filter.'_'.(int)$only_advance_payment_products;
foreach ($package['products'] as $key => $product) {
if ($only_advance_payment_products) {
if ($advancePaymentInfo = $objHotelAdvancePayment->getIdAdvPaymentByIdProduct($product['id_product'])) {
@@ -1498,4 +1501,25 @@ class CartRuleCore extends ObjectModel
return Db::getInstance()->executeS($sql_base.' AND code LIKE \'%'.pSQL($name).'%\'');
}
}
public static function getGeneratedBy($id)
{
if (!$id) {
return false;
}
$response = array();
$sql = 'SELECT `id_order_slip` FROM '._DB_PREFIX_.'order_slip os
WHERE os.`id_cart_rule` = '.(int)$id;
if ($result = Db::getInstance()->getValue($sql)) {
$response['generated_by'] = self::GENERATED_BY_ORDER_SLIP;
$response['id_generated_by'] = $result;
}
$sql = 'SELECT `id_order_return` FROM '._DB_PREFIX_.'order_return o
WHERE o.`return_type` = '.OrderReturn::RETURN_TYPE_CART_RULE.' AND o.`id_return_type` = '.(int)$id;
if ($result = Db::getInstance()->getValue($sql)) {
$response['generated_by'] = self::GENERATED_BY_REFUND;
$response['id_generated_by'] = $result;
}
return $response;
}
}

View File

@@ -1650,8 +1650,6 @@ abstract class PaymentModuleCore extends Module
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
$result['total_extra_demands_te'] = 0;
$result['total_extra_demands_ti'] = 0;
$result['total_additional_services_te'] =0;
$result['total_additional_services_ti'] =0;
$cart_htl_data = array();
if (!empty($products)) {
foreach ($products as $type_key => $type_value) {
@@ -1697,67 +1695,12 @@ abstract class PaymentModuleCore extends Module
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] = $roomTypeDateRangePrice['total_price_tax_incl']*$vart_quant;
// extra demands prices
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order->id,
$type_value['product_id'],
0,
$data_v['date_from'],
$data_v['date_to']
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order->id,
$type_value['product_id'],
0,
$data_v['date_from'],
$data_v['date_to'],
0,
1,
0
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order->id,
$type_value['product_id'],
0,
$data_v['date_from'],
$data_v['date_to'],
0,
1,
1
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
1,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
0,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] += ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti']);
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] += ($data_v['total_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_excl'] += ($data_v['total_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] += $data_v['total_price_tax_incl'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_excl'] += $data_v['total_price_tax_excl'];
} else {
$num_days = $obj_htl_bk_dtl->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
@@ -1809,28 +1752,6 @@ abstract class PaymentModuleCore extends Module
$data_v['date_from'],
$data_v['date_to']
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
1
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
0
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
@@ -1838,7 +1759,7 @@ abstract class PaymentModuleCore extends Module
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
0,
1,
1,
1,
@@ -1851,7 +1772,7 @@ abstract class PaymentModuleCore extends Module
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
0,
1,
0,
1,
@@ -1867,8 +1788,6 @@ abstract class PaymentModuleCore extends Module
$result['total_extra_demands_te'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'];
$result['total_extra_demands_ti'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'];
$result['total_additional_services_te'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_te'];
$result['total_additional_services_ti'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_ti'];
}
}
// calculate averages now

View File

@@ -206,6 +206,11 @@ class OrderReturnCore extends ObjectModel
$objBookingDemands = new HotelBookingDemands();
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
$calcServicePriceFirst = false;
if ($objOrder->is_advance_payment && $objOrder->advance_paid_amount <= $objOrder->total_paid_real) {
$calcServicePriceFirst = true;
}
foreach ($returnDetails as $key => &$bookingRow) {
if ($skipReqCompletedNonRefunded) {
$objReturnState = new OrderReturnState($bookingRow['id_return_state']);
@@ -219,24 +224,27 @@ class OrderReturnCore extends ObjectModel
$bookingRow['extra_service_total_paid_amount'] = 0;
$bookingRow['extra_service_total_price_tax_incl'] = 0;
$bookingRow['room_paid_amount'] = 0;
if ($bookingRow['total_price_tax_incl'] > 0) {
if ($objOrder->total_paid_real > 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
0,
0,
1,
$bookingRow['id']
);
if (count($roomSelectedDemands)) {
foreach ($roomSelectedDemands as $demand) {
if ($demand['total_price_tax_incl'] > 0) {
if ($objOrder->total_paid_real > 0) {
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$demand['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
if ($calcServicePriceFirst) {
$bookingRow['extra_service_total_paid_amount'] += $demand['total_price_tax_incl'];
} else {
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$demand['total_price_tax_incl'])/($objOrder->total_paid_tax_incl + $objOrder->total_discounts_tax_incl);
}
}
$bookingRow['extra_service_total_price_tax_incl'] += $demand['total_price_tax_incl'];
}
@@ -250,13 +258,27 @@ class OrderReturnCore extends ObjectModel
foreach ($roomSelectedServices['additional_services'] as $service) {
if ($service['total_price_tax_incl'] > 0) {
if ($objOrder->total_paid_real > 0) {
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$service['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
if ($calcServicePriceFirst) {
$bookingRow['extra_service_total_paid_amount'] += $service['total_price_tax_incl'];
} else {
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$service['total_price_tax_incl'])/($objOrder->total_paid_tax_incl + $objOrder->total_discounts_tax_incl);
}
}
$bookingRow['extra_service_total_price_tax_incl'] += $service['total_price_tax_incl'];
}
}
}
}
if ($bookingRow['total_price_tax_incl'] > 0) {
if ($objOrder->total_paid_real > 0) {
if ($calcServicePriceFirst) {
$totalRoomShare = ($objOrder->total_paid_real*($bookingRow['total_price_tax_incl'] + $bookingRow['extra_service_total_price_tax_incl'])/ ($objOrder->total_paid_tax_incl + $objOrder->total_discounts_tax_incl));
$bookingRow['room_paid_amount'] += $totalRoomShare - $bookingRow['extra_service_total_price_tax_incl'];
} else {
$bookingRow['room_paid_amount'] = ($objOrder->total_paid_real*$bookingRow['total_price_tax_incl'])/ ($objOrder->total_paid_tax_incl + $objOrder->total_discounts_tax_incl);
}
}
}
if ($customerView) {
$dateJoin = $bookingRow['id_product'].'_'.strtotime($bookingRow['date_from']).strtotime($bookingRow['date_to']);
if (isset($returnsCustView[$dateJoin]['num_rooms'])) {

View File

@@ -54,4 +54,30 @@ class OrderReturnDetailCore extends ObjectModel
'refunded_amount' => array('type' => self::TYPE_FLOAT),
),
);
public static function getReturnDetailByIdBookingDetail($idHtlBooking)
{
$idOrderReturnDetail = Db::getInstance()->getValue('
SELECT `id_order_return_detail` FROM `'._DB_PREFIX_.'order_return_detail` ord
WHERE `id_htl_booking` = '.(int)$idHtlBooking
);
if ($idOrderReturnDetail) {
return new OrderReturnDetail($idOrderReturnDetail);
}
return null;
}
public static function deleteReturnDetailByIdBookingDetail($idOrder, $idHtlBooking)
{
if (Validate::isLoadedObject($objOrderReturnDetail = OrderReturnDetail::getReturnDetailByIdBookingDetail($idHtlBooking))) {
if ($objOrderReturnDetail->delete()) {
$objOrderReturn = new OrderReturn();
if (empty($objOrderReturn->getOrderRefundRequestedBookings($idOrder, $objOrderReturnDetail->id_order_return, true))) {
$objOrderReturn = new OrderReturn($objOrderReturnDetail->id_order_return);
$objOrderReturn->delete();
}
}
}
}
}

View File

@@ -372,62 +372,6 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$cart_htl_data[$type_key]['unit_price_tax_incl'] = $unit_price_tax_incl;
if (isset($cart_htl_data[$type_key]['date_diff'][$date_join])) {
// $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
// $order_obj->id,
// $type_value['product_id'],
// 0,
// $data_v['date_from'],
// $data_v['date_to']
// );
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order_obj->id,
$type_value['product_id'],
0,
$data_v['date_from'],
$data_v['date_to'],
0,
1,
0,
$type_value['id_order_detail']
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order_obj->id,
$type_value['product_id'],
0,
$data_v['date_from'],
$data_v['date_to'],
0,
1,
1,
$type_value['id_order_detail']
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order_obj->id,
0,
0,
$data_v['id_product'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
1,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order_obj->id,
0,
0,
$data_v['id_product'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
0,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'] += 1;
$cart_htl_data[$type_key]['date_diff'][$date_join]['adults'] += $data_v['adults'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['children'] += $data_v['children'];
@@ -437,20 +381,13 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_excl']/$num_days;
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] += ($data_v['total_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] += ($data_v['total_price_tax_excl']);
// For order refund
$cart_htl_data[$type_key]['date_diff'][$date_join]['id_room'] = $data_v['id_room'];
} else {
// $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
// $order_obj->id,
// $type_value['product_id'],
// 0,
// $data_v['date_from'],
// $data_v['date_to']
// );
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order_obj->id,
$type_value['product_id'],
@@ -513,7 +450,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$data_v['id_product'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
0,
1,
1,
1,
@@ -526,7 +463,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$data_v['id_product'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
0,
1,
0,
1,
@@ -559,7 +496,11 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$type_value['product_id'],
$data_v['id_room'],
$data_v['date_from'],
$data_v['date_to']
$data_v['date_to'],
1,
0,
1,
$data_v['id']
)) {
$extraDemands = array_shift($extraDemands);
$extraDemands['product_id'] = $type_value['product_id'];
@@ -569,16 +510,12 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$room_extra_demands[] = $extraDemands;
}
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order_obj->id,
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$data_v['id'],
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room']
1,
0
)) {
$additionalServices = array_shift($additionalServices);
$additionalServices['product_id'] = $type_value['product_id'];
$additionalServices['room_type_name'] = $type_value['product_name'];
$additionalServices['date_from'] = $data_v['date_from'];

View File

@@ -41,7 +41,8 @@ class AdminCartRulesControllerCore extends AdminController
$this->context = Context::getContext();
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'),'icon' => 'icon-trash', 'confirm' => $this->l('Delete selected items?')));
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'),'icon' => 'icon-trash'));
$this->specificConfirmDelete = false;
$this->fields_list = array(
'id_cart_rule' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'),
@@ -143,15 +144,117 @@ class AdminCartRulesControllerCore extends AdminController
echo json_encode(array('html' => $html, 'next_link' => $next_link));
}
public function ajaxProcessInitCartRuleDeleteModal()
{
$response = array('success' => false);
$modalConfirmDelete = $this->createTemplate('modal_confirm_delete.tpl');
$modalClass = 'modal-md';
if ($idCartRule = Tools::getValue('id_cart_rule')) {
if ($generatedByDetails = CartRule::getGeneratedBy($idCartRule)) {
if (Validate::isLoadedObject($objCartRule = new CartRule($idCartRule, $this->context->language->id))) {
if ($generatedByDetails['generated_by'] == CartRule::GENERATED_BY_REFUND) {
$obj = new OrderReturn($generatedByDetails['id_generated_by']);
} else {
$obj = new OrderSlip($generatedByDetails['id_generated_by']);
}
$objOrder = new Order($obj->id_order);
$objCustomer = new Customer($objOrder->id_customer);
$modalConfirmDelete->assign(array(
'generatedBy' => $generatedByDetails['generated_by'],
'generatedById' => $generatedByDetails['id_generated_by'],
'customer' => $objCustomer,
'order' => $objOrder,
'cartRule' => $objCartRule,
'link' => $this->context->link
));
$modalClass = 'modal-lg';
}
}
}
$tpl = $this->createTemplate('modal.tpl');
$tpl->assign(array(
'modal_id' => 'moduleConfirmDelete',
'modal_class' => $modalClass,
'modal_content' => $modalConfirmDelete->fetch(),
'modal_actions' => array(
array(
'type' => 'button',
'class' => 'process_delete btn-primary',
'label' => $this->l('Delete'),
),
),
));
$response['confirm_delete'] = true;
$response['modalHtml'] = $tpl->fetch();
$response['confirm_delete'] = true;
$response['success'] = true;
die(Tools::jsonEncode($response));
}
public function ajaxProcessInitCartRuleBulkDeleteModal()
{
$response = array('success' => false);
$modalConfirmDelete = $this->createTemplate('modal_confirm_bulk_delete.tpl');
if ($idCartRules = Tools::getValue('id_cart_rules')) {
$toConfirm = array();
foreach($idCartRules as $idCartRule) {
if ($ruleDetails = CartRule::getGeneratedBy($idCartRule)) {
$ruleDetails['id_cart_rule'] = $idCartRule;
$objCartRule = new CartRule($idCartRule, $this->context->language->id);
$ruleDetails['cart_rule'] = $objCartRule;
if ($ruleDetails['generated_by'] == CartRule::GENERATED_BY_REFUND) {
$obj = new OrderReturn($ruleDetails['id_generated_by']);
} else {
$obj = new OrderSlip($ruleDetails['id_generated_by']);
}
$objOrder = new Order($obj->id_order);
$ruleDetails['order'] = $objOrder;
$toConfirm[] = $ruleDetails;
}
}
if (count($toConfirm)) {
$modalConfirmDelete->assign(array(
'cartRules' => $toConfirm,
'link' => $this->context->link
));
}
}
$tpl = $this->createTemplate('modal.tpl');
$tpl->assign(array(
'modal_id' => 'moduleConfirmDelete',
'modal_class' => 'modal-md',
'modal_content' => $modalConfirmDelete->fetch(),
'modal_actions' => array(
array(
'type' => 'button',
'class' => 'process_delete btn-primary',
'label' => $this->l('Delete'),
),
),
));
$response['confirm_delete'] = true;
$response['modalHtml'] = $tpl->fetch();
$response['success'] = true;
die(Tools::jsonEncode($response));
}
public function setMedia()
{
parent::setMedia();
Media::addJsDef(
array(
'admin_cart_rule_tab_link' => $this->context->link->getAdminLink('AdminCartRules'),
'room_access_err' => $this->l('You can only select room types which hotel(s) access is provided to this employee.'),
'room_rmv_txt' => $this->l('Unselect below room types'),
)
);
$this->addJS(_PS_JS_DIR_.'admin/cart-rules.js');
$this->addJqueryPlugin(array('typewatch', 'fancybox', 'autocomplete'));
}

View File

@@ -946,6 +946,11 @@ class AdminCartsControllerCore extends AdminController
$date_from = date('Y-m-d', strtotime($date_from));
$date_to = date('Y-m-d', strtotime($date_to));
if ($this->context->cart->id_currency != (int)Configuration::get('PS_CURRENCY_DEFAULT')) {
$currency = Currency::getCurrencyInstance($this->context->cart->id_currency);
$price = Tools::ps_round($price/$currency->conversion_rate, 6);
}
if ($this->tabAccess['edit'] === '1') {
HotelRoomTypeFeaturePricing::deleteByIdCart($id_cart, $id_product, $id_room, $date_from, $date_to);
$feature_price_name = array();
@@ -977,7 +982,7 @@ class AdminCartsControllerCore extends AdminController
if ($bookingInfo['id'] == $id_booking_data) {
$amt_with_qty = $bookingInfo['amt_with_qty'];
$bookingInfo['amt_with_qty'] = Tools::displayPrice($amt_with_qty);
$bookingInfo['total_price'] = Tools::displayPrice($amt_with_qty + $bookingInfo['demand_price'] + $bookingInfo['additional_service_price']);
$bookingInfo['total_price'] = Tools::displayPrice($amt_with_qty + $bookingInfo['demand_price'] + $bookingInfo['additional_service_price'] + $bookingInfo['additional_services_auto_add_price']);
$response = array(
'curr_booking_info' => $bookingInfo,
'cart_info' => $this->ajaxReturnVars(),

View File

@@ -867,8 +867,9 @@ class AdminOrdersControllerCore extends AdminController
&& ($idRoom = Tools::getValue('id_room'))
&& ($dateFrom = Tools::getValue('date_from'))
&& ($dateTo = Tools::getValue('date_to'))
&& ($productLineData = Tools::getValue('product_line_data'))
) {
$productLineData = json_decode(Tools::getValue('product_line_data'), true);
$productLineData = json_decode($productLineData, true);
$smartyVars = array(
'order' => $objOrder,
@@ -883,16 +884,7 @@ class AdminOrdersControllerCore extends AdminController
$smartyVars['currencySign'] = $objCurrency->sign;
$smartyVars['link'] = $this->context->link;
$objBookingDemand = new HotelBookingDetail();
$htlBookingDetail = $objBookingDemand->getRowByIdOrderIdProductInDateRange(
$idOrder,
$idProduct,
$dateFrom,
$dateTo,
$idRoom
);
$smartyVars['id_booking_detail'] = $htlBookingDetail['id'];
$smartyVars['id_booking_detail'] = $productLineData['id'];
$objBookingDemand = new HotelBookingDemands();
@@ -901,10 +893,14 @@ class AdminOrdersControllerCore extends AdminController
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
$idProduct,
$idRoom,
$dateFrom,
$dateTo
0,
0,
0,
0,
1,
0,
1,
$productLineData['id']
)) {
$smartyVars['extraDemands'] = $extraDemands;
}
@@ -923,7 +919,7 @@ class AdminOrdersControllerCore extends AdminController
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$htlBookingDetail['id']
$productLineData['id']
)) {
$smartyVars['additionalServices'] = $additionalServices;
}
@@ -2748,8 +2744,6 @@ class AdminOrdersControllerCore extends AdminController
$total_room_tax = 0;
$totalRoomsCostTE = 0;
$totalConvenienceFeeTE = 0;
$totalConvenienceFeeTI = 0;
$totalDemandsPriceTE = 0;
$totalDemandsPriceTI = 0;
$totalRefundedRooms = 0;
@@ -2765,7 +2759,11 @@ class AdminOrdersControllerCore extends AdminController
$value['id_product'],
$value['id_room'],
$value['date_from'],
$value['date_to']
$value['date_to'],
1,
0,
1,
$value['id']
);
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['extra_demands_price_ti'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order->id,
@@ -2775,7 +2773,8 @@ class AdminOrdersControllerCore extends AdminController
$value['date_to'],
0,
1,
1
1,
$value['id']
);
$totalDemandsPriceTI += $order_detail_data[$key]['extra_demands_price_ti'];
$order_detail_data[$key]['total_room_price_te'] += $order_detail_data[$key]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
@@ -2786,69 +2785,38 @@ class AdminOrdersControllerCore extends AdminController
$value['date_to'],
0,
1,
0
0,
$value['id']
);
$totalDemandsPriceTE += $order_detail_data[$key]['extra_demands_price_te'];
$order_detail_data[$key]['additional_services'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
$value['id_product'],
$value['date_from'],
$value['date_to'],
$value['id_room'],
0,
null,
null
$order_detail_data[$key]['additional_services'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$value['id']
);
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['additional_services_price_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
$value['id_product'],
$value['date_from'],
$value['date_to'],
$value['id_room'],
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['additional_services_price_ti'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$value['id'],
1,
1
);
$order_detail_data[$key]['total_room_price_te'] += $order_detail_data[$key]['additional_services_price_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
$value['id_product'],
$value['date_from'],
$value['date_to'],
$value['id_room'],
1,
0
);
$order_detail_data[$key]['total_room_price_te'] += $order_detail_data[$key]['additional_services_price_te'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$value['id'],
1,
0,
0
);
$order_detail_data[$key]['convenience_fee_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
$value['id_product'],
$value['date_from'],
$value['date_to'],
$value['id_room'],
$order_detail_data[$key]['convenience_fee_ti'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$value['id'],
1,
1,
1,
Product::PRICE_ADDITION_TYPE_INDEPENDENT
);
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['convenience_fee_ti'];
$totalConvenienceFeeTI += $order_detail_data[$key]['convenience_fee_ti'];
$order_detail_data[$key]['convenience_fee_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
$value['id_product'],
$value['date_from'],
$value['date_to'],
$value['id_room'],
$order_detail_data[$key]['convenience_fee_te'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$value['id'],
1,
0,
1,
@@ -2856,16 +2824,9 @@ class AdminOrdersControllerCore extends AdminController
);
$order_detail_data[$key]['total_room_price_te'] += $order_detail_data[$key]['convenience_fee_te'];
$totalConvenienceFeeTE += $order_detail_data[$key]['convenience_fee_te'];
$order_detail_data[$key]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
$value['id_product'],
$value['date_from'],
$value['date_to'],
$value['id_room'],
$order_detail_data[$key]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$value['id'],
1,
1,
1,
@@ -2873,14 +2834,8 @@ class AdminOrdersControllerCore extends AdminController
);
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['additional_services_price_auto_add_ti'];
$order_detail_data[$key]['additional_services_price_auto_add_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
$value['id_product'],
$value['date_from'],
$value['date_to'],
$value['id_room'],
$order_detail_data[$key]['additional_services_price_auto_add_te'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$value['id'],
1,
0,
1,
@@ -2997,8 +2952,6 @@ class AdminOrdersControllerCore extends AdminController
'refundedAmount' => $refundedAmount,
'totalDemandsPriceTI' => $totalDemandsPriceTI,
'totalDemandsPriceTE' => $totalDemandsPriceTE,
'totalConvenienceFeeTI' => $totalConvenienceFeeTI,
'totalConvenienceFeeTE' => $totalConvenienceFeeTE,
'totalRoomsCostTE' => $totalRoomsCostTE,
'total_room_tax' => $total_room_tax,
'htl_booking_order_data' => $bookingOrderInfo,
@@ -5287,41 +5240,20 @@ class AdminOrdersControllerCore extends AdminController
$id_order = (int) Tools::getValue('id_order');
$order = new Order($id_order);
/*By webkul To delete Order and cart entries when deleting rooms from the orderLine when editing the order*/
$date_from = Tools::getValue('date_from');
$date_to = Tools::getValue('date_to');
$id_hotel = Tools::getValue('id_hotel');
$id_room = Tools::getValue('id_room');
$id_product = Tools::getValue('id_product');
$obj_booking_detail = new HotelBookingDetail();
$product_quantity = (int) $obj_booking_detail->getNumberOfDays($date_from, $date_to);
/*By webkul to validate fields before deleting the cart and order data form the tables*/
if ($id_hotel == '') {
/*By webkul to validate booking before deleting the cart and order data form the tables*/
if (($idHotelBooking = Tools::getValue('id_htl_booking')) == '') {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Hotel Id is mising.'),
'error' => Tools::displayError('Booking id not found.'),
)));
} elseif ($id_room == '') {
} elseif (!Validate::isLoadedObject($objBookingDetail = new HotelBookingDetail($idHotelBooking))) {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Room Id is missing.'),
'error' => Tools::displayError('Booking Detail not found.'),
)));
} elseif ($date_from == '') {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Check In Date is missing.'),
)));
} elseif ($date_to == '') {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Check Out Date is missing.'),
)));
} elseif ($date_to == '') {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Check Out Date is missing.'),
)));
} elseif (!Validate::isUnsignedInt($product_quantity)) {
}
$product_quantity = (int) $objBookingDetail->getNumberOfDays($objBookingDetail->date_from, $objBookingDetail->date_to);
if (!Validate::isUnsignedInt($product_quantity)) {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Invalid quantity.'),
@@ -5331,32 +5263,31 @@ class AdminOrdersControllerCore extends AdminController
/*END*/
$this->doDeleteProductLineValidation($order_detail, $order);
Hook::exec('actionOrderProductLineDeleteBefore', array('order' => $order));
$bookingInfo = $obj_booking_detail->getRowByIdOrderIdProductInDateRange($id_order, $id_product, $date_from, $date_to, $id_room);
$idHotelBooking = $bookingInfo['id'];
$bookingPriceTaxIncl = $bookingInfo['total_price_tax_incl'];
$bookingPriceTaxExcl = $bookingInfo['total_price_tax_excl'];
$bookingPriceTaxIncl = $objBookingDetail->total_price_tax_incl;
$bookingPriceTaxExcl = $objBookingDetail->total_price_tax_excl;
$objBookingDemand = new HotelBookingDemands();
$roomExtraDemandTI = $objBookingDemand->getRoomTypeBookingExtraDemands(
$id_order,
$id_product,
$id_room,
$date_from,
$date_to,
$objBookingDetail->id_product,
$objBookingDetail->id_room,
$objBookingDetail->date_from,
$objBookingDetail->date_to,
0,
1,
1
1,
$objBookingDetail->id
);
$roomExtraDemandTE = $objBookingDemand->getRoomTypeBookingExtraDemands(
$id_order,
$id_product,
$id_room,
$date_from,
$date_to,
$objBookingDetail->id_product,
$objBookingDetail->id_room,
$objBookingDetail->date_from,
$objBookingDetail->date_to,
0,
1,
0
0,
$objBookingDetail->id
);
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
@@ -5508,10 +5439,18 @@ class AdminOrdersControllerCore extends AdminController
/*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();
$delete_room_order = $obj_htl_cart_booking->deleteOrderedRoomFromCart($id_order, $id_hotel, $id_room, $date_from, $date_to);
$delete_room_order = $obj_htl_cart_booking->deleteCartBookingData(
$objBookingDetail->id_cart,
$objBookingDetail->id_product,
$objBookingDetail->id_room,
$objBookingDetail->date_from,
$objBookingDetail->date_to
);
$obj_htl_booking = new HotelBookingDetail();
$delete_room_order = $obj_htl_booking->deleteOrderedRoomFromOrder($id_order, $id_hotel, $id_room, $date_from, $date_to);
$objBookingDetail->delete();
// delete refund request of the room if exists.
OrderReturnDetail::deleteReturnDetailByIdBookingDetail($id_order, $idHotelBooking);
// Assign to smarty informations in order to show the new product line
$this->context->smarty->assign(array(
@@ -6021,6 +5960,7 @@ class AdminOrdersControllerCore extends AdminController
$obj_hotel_cart_detail = new HotelCartBookingData();
$deleted = $obj_hotel_cart_detail->deleteRowById($del_id);
if ($deleted) {
HotelRoomTypeFeaturePricing::deleteByIdCart($cart_id, $id_product, $room_id, $dt_frm, $dt_to );
$obj_product_process = new HotelCartBookingData();
$date_from = date_create($dt_frm);
$date_to = date_create($dt_to);
@@ -6068,6 +6008,7 @@ class AdminOrdersControllerCore extends AdminController
&& ($idRoom = Tools::getValue('id_room'))
&& ($dateFrom = Tools::getValue('date_from'))
&& ($dateTo = Tools::getValue('date_to'))
&& ($idHtlBooking = Tools::getValue('id_htl_booking'))
) {
$smartyVars = array();
$objOrder = new Order($idOrder);
@@ -6076,16 +6017,7 @@ class AdminOrdersControllerCore extends AdminController
$smartyVars['currencySign'] = $objCurrency->sign;
$smartyVars['link'] = $this->context->link;
$objBookingDemand = new HotelBookingDetail();
$htlBookingDetail = $objBookingDemand->getRowByIdOrderIdProductInDateRange(
$idOrder,
$idProduct,
$dateFrom,
$dateTo,
$idRoom
);
$smartyVars['id_booking_detail'] = $htlBookingDetail['id'];
$smartyVars['id_booking_detail'] = $idHtlBooking;
$objBookingDemand = new HotelBookingDemands();
@@ -6097,14 +6029,18 @@ class AdminOrdersControllerCore extends AdminController
$idProduct,
$idRoom,
$dateFrom,
$dateTo
$dateTo,
1,
0,
1,
$idHtlBooking
)) {
$smartyVars['extraDemands'] = $extraDemands;
}
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$htlBookingDetail['id']
$idHtlBooking
)) {
$smartyVars['additionalServices'] = $additionalServices;
}
@@ -6132,7 +6068,7 @@ class AdminOrdersControllerCore extends AdminController
die($response);
}
public function processRenderServicesPanel($idOrder, $idProduct, $dateFrom, $dateTo, $idRoom, $orderEdit)
public function processRenderServicesPanel($idOrder, $idProduct, $dateFrom, $dateTo, $idRoom, $idHtlBookingDetail, $orderEdit)
{
$smartyVars = array();
$objOrder = new Order($idOrder);
@@ -6141,19 +6077,10 @@ class AdminOrdersControllerCore extends AdminController
$smartyVars['currencySign'] = $objCurrency->sign;
$smartyVars['link'] = $this->context->link;
$objBookingDemand = new HotelBookingDetail();
$htlBookingDetail = $objBookingDemand->getRowByIdOrderIdProductInDateRange(
$idOrder,
$idProduct,
$dateFrom,
$dateTo,
$idRoom
);
$smartyVars['id_booking_detail'] = $htlBookingDetail['id'];
$smartyVars['id_booking_detail'] = $idHtlBookingDetail;
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$htlBookingDetail['id']
$idHtlBookingDetail
)) {
$smartyVars['additionalServices'] = $additionalServices;
}
@@ -6184,7 +6111,7 @@ class AdminOrdersControllerCore extends AdminController
return $servicesTpl;
}
public function processRenderFacilitiesBlock($idOrder, $idProduct, $dateFrom, $dateTo, $idRoom, $orderEdit)
public function processRenderFacilitiesBlock($idOrder, $idProduct, $dateFrom, $dateTo, $idRoom, $idHtlBookingDetail, $orderEdit)
{
$smartyVars = array();
$objOrder = new Order($idOrder);
@@ -6192,17 +6119,7 @@ class AdminOrdersControllerCore extends AdminController
$smartyVars['orderCurrency'] = $objOrder->id_currency;
$smartyVars['currencySign'] = $objCurrency->sign;
$smartyVars['link'] = $this->context->link;
$objBookingDemand = new HotelBookingDetail();
$htlBookingDetail = $objBookingDemand->getRowByIdOrderIdProductInDateRange(
$idOrder,
$idProduct,
$dateFrom,
$dateTo,
$idRoom
);
$smartyVars['id_booking_detail'] = $htlBookingDetail['id'];
$smartyVars['id_booking_detail'] = $idHtlBookingDetail;
// set context currency So that we can get prices in the order currency
$this->context->currency = new Currency($objOrder->id_currency);
@@ -6214,7 +6131,11 @@ class AdminOrdersControllerCore extends AdminController
$idProduct,
$idRoom,
$dateFrom,
$dateTo
$dateTo,
1,
0,
1,
$idHtlBookingDetail
)) {
$smartyVars['extraDemands'] = $extraDemands;
}
@@ -6269,11 +6190,13 @@ class AdminOrdersControllerCore extends AdminController
$objHotelBookingDetail = new HotelBookingDetail($objRoomTypeServiceProductOrderDetail->id_htl_booking_detail);
$res = true;
if (!$response['hasError']) {
$oldPriceTaxExcl = $objRoomTypeServiceProductOrderDetail->unit_price_tax_excl;
$oldPriceTaxIncl = $objRoomTypeServiceProductOrderDetail->unit_price_tax_incl;
$oldUnitPriceTaxExcl = $objRoomTypeServiceProductOrderDetail->unit_price_tax_excl;
$oldUnitPriceTaxIncl = $objRoomTypeServiceProductOrderDetail->unit_price_tax_incl;
$oldTotalPriceTaxExcl = $objRoomTypeServiceProductOrderDetail->total_price_tax_excl;
$oldTotalPriceTaxIncl = $objRoomTypeServiceProductOrderDetail->total_price_tax_incl;
$oldQuantity = $objRoomTypeServiceProductOrderDetail->quantity;
if ($oldPriceTaxExcl > 0) {
$oldTaxMultiplier = $oldPriceTaxIncl / $oldPriceTaxExcl;
$oldTaxMultiplier = $oldUnitPriceTaxIncl / $oldUnitPriceTaxExcl;
} else {
$oldTaxMultiplier = 1;
}
@@ -6293,8 +6216,8 @@ class AdminOrdersControllerCore extends AdminController
$objRoomTypeServiceProductOrderDetail->total_price_tax_incl = Tools::ps_round($objRoomTypeServiceProductOrderDetail->unit_price_tax_incl * $quantity, 6);
if ($res &= $objRoomTypeServiceProductOrderDetail->save()) {
$order = new Order($objRoomTypeServiceProductOrderDetail->id_order);
$priceDiffTaxExcl = $objRoomTypeServiceProductOrderDetail->total_price_tax_excl - $oldPriceTaxExcl;
$priceDiffTaxIncl = $objRoomTypeServiceProductOrderDetail->total_price_tax_incl - $oldPriceTaxIncl;
$priceDiffTaxExcl = $objRoomTypeServiceProductOrderDetail->total_price_tax_excl - $oldTotalPriceTaxExcl;
$priceDiffTaxIncl = $objRoomTypeServiceProductOrderDetail->total_price_tax_incl - $oldTotalPriceTaxIncl;
$quantityDiff = $objRoomTypeServiceProductOrderDetail->quantity - $oldQuantity;
$objOrderDetail->product_quantity += $quantityDiff;
@@ -6332,6 +6255,7 @@ class AdminOrdersControllerCore extends AdminController
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to,
$objHotelBookingDetail->id_room,
$objHotelBookingDetail->id,
true
);
} else {
@@ -6391,6 +6315,7 @@ class AdminOrdersControllerCore extends AdminController
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to,
$objHotelBookingDetail->id_room,
$objHotelBookingDetail->id,
true
);
}
@@ -6644,6 +6569,7 @@ class AdminOrdersControllerCore extends AdminController
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to,
$objHotelBookingDetail->id_room,
$objHotelBookingDetail->id,
true
);
} else {
@@ -6772,6 +6698,7 @@ class AdminOrdersControllerCore extends AdminController
$objBookingDetail->date_from,
$objBookingDetail->date_to,
$objBookingDetail->id_room,
$objBookingDetail->id,
true
);
$response['success'] = true;
@@ -6842,6 +6769,7 @@ class AdminOrdersControllerCore extends AdminController
$objBookingDetail->date_from,
$objBookingDetail->date_to,
$objBookingDetail->id_room,
$objBookingDetail->id,
true
);
$response['success'] = true;
@@ -6886,6 +6814,7 @@ class AdminOrdersControllerCore extends AdminController
$objBookingDetail->date_from,
$objBookingDetail->date_to,
$objBookingDetail->id_room,
$objBookingDetail->id,
true
);
$response['success'] = true;

View File

@@ -296,9 +296,51 @@ class AdminSlipControllerCore extends AdminController
return '--';
}
public function ajaxProcessInitSlipStatusModal()
{
$response = array('success' => false);
if ($idOrderSlip = Tools::getValue('id_order_slip')) {
if (Validate::isLoadedObject($objOrderSlip = new OrderSlip($idOrderSlip, $this->context->language->id))) {
$objOrder = new Order($objOrderSlip->id_order);
$objCustomer = new Customer($objOrder->id_customer);
$modalConfirmDelete = $this->createTemplate('modal_confirm_update.tpl');
$modalConfirmDelete->assign(array(
'customer' => $objCustomer,
'order' => $objOrder,
'orderSlip' => $objOrderSlip,
'link' => $this->context->link
));
$tpl = $this->createTemplate('modal.tpl');
$tpl->assign(array(
'modal_id' => 'moduleConfirmUpdate',
'modal_class' => 'modal-md',
'modal_content' => $modalConfirmDelete->fetch(),
'modal_actions' => array(
array(
'type' => 'button',
'class' => 'process_update btn-primary',
'label' => $this->l('Change status'),
),
),
));
$response['modalHtml'] = $tpl->fetch();
}
}
$response['success'] = true;
die(Tools::jsonEncode($response));
}
public function setMedia()
{
parent::setMedia();
Media::addJsDef(
array(
'admin_order_slip_tab_link' => $this->context->link->getAdminLink('AdminSlip'),
)
);
$this->addJS(_PS_JS_DIR_.'admin/slips.js');
}

View File

@@ -94,6 +94,7 @@ class InstallControllerHttpSystem extends InstallControllerHttp
'pdo_mysql' => $this->l('PDO MySQL extension is not loaded'),
'curl' => $this->l('Curl extension is not loaded'),
'soap' => $this->l('SOAP extension is not loaded'),
'openssl' => $this->l('OpenSSL extension is not loaded.'),
'simplexml' => $this->l('SimpleXml extension is not loaded'),
'memory_limit' => $this->l('In the PHP configuration set memory_limit to minimum 128M'),
'max_execution_time' => $this->l('In the PHP configuration set max_execution_time to minimum 500'),

143
js/admin/cart-rules.js Normal file
View File

@@ -0,0 +1,143 @@
/**
* Since 2010 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through this link for complete license : https://store.webkul.com/license.html
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
*
* @author Webkul IN <support@webkul.com>
* @copyright Since 2010 Webkul IN
* @license https://store.webkul.com/license.html
*/
$(document).ready(function() {
$('.btn-group-action .delete').on('click', function (e) {
e.preventDefault();
var id_cart_rule = $.trim($(this).closest('tr').find('td[data-key="id_cart_rule"]').text());
processDelete(id_cart_rule, $(this).attr('href'))
return false;
});
function processDelete(id_cart_rule, link)
{
confirmDelete(id_cart_rule).then((toDelete) => {
if (toDelete) {
window.location = link;
}
});
}
function confirmDelete(id_cart_rule)
{
return new Promise((resolve) => {
$.ajax({
type: 'POST',
url: admin_cart_rule_tab_link,
dataType: 'JSON',
cache: false,
data: {
ajax: true,
action: 'initCartRuleDeleteModal',
id_cart_rule: id_cart_rule
},
success: function(result) {
if (result.success && result.confirm_delete) {
$('#moduleConfirmDelete').remove();
$('#footer').next('.bootstrap').append(result.modalHtml);
$('#moduleConfirmDelete').modal('show');
$('#moduleConfirmDelete .process_delete').click(() => {
resolve(true);
});
$('#moduleConfirmDelete .btn-close').click(() => {
resolve(false);
});
}
}
});
});
}
});
function confirmDeleteBulk(form)
{
var id_cart_rules = [];
$(form).find('[name="cart_ruleBox[]"]:checked').each(function () {
id_cart_rules.push($(this).val());
});
return new Promise((resolve) => {
$.ajax({
type: 'POST',
url: admin_cart_rule_tab_link,
dataType: 'JSON',
cache: false,
data: {
ajax: true,
action: 'initCartRuleBulkDeleteModal',
id_cart_rules: id_cart_rules
},
success: function(result) {
if (result.success && result.confirm_delete) {
$('#moduleConfirmDelete').remove();
$('#footer').next('.bootstrap').append(result.modalHtml);
$('#moduleConfirmDelete').modal('show');
$('#moduleConfirmDelete .process_delete').click(() => {
resolve(true);
});
$('#moduleConfirmDelete .btn-close').click(() => {
resolve(false);
});
}
},
});
});
}
function sendBulkAction(form, action)
{
if (action.search('delete')!= -1) {
confirmDeleteBulk(form).then((toDelete) => {
if (toDelete) {
submitBulkActionForm(form, action);
}
});
} else {
submitBulkActionForm(form, action);
}
}
function submitBulkActionForm(form, action)
{
String.prototype.splice = function(index, remove, string) {
return (this.slice(0, index) + string + this.slice(index + Math.abs(remove)));
};
var form_action = $(form).attr('action');
if (form_action.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,'').replace(/\s+/g,' ') == '')
return false;
if (form_action.indexOf('#') == -1)
$(form).attr('action', form_action + '&' + action);
else
$(form).attr('action', form_action.splice(form_action.lastIndexOf('&'), 0, '&' + action));
$(form).submit();
}
$(document).on('change', '.cart_rule_to_delete', function() {
if ($(this).prop('checked')) {
$('[name="cart_ruleBox[]"][value="'+$(this).val()+'"]').prop('checked', true);
} else {
$('[name="cart_ruleBox[]"][value="'+$(this).val()+'"]').prop('checked', false);
}
});

View File

@@ -37,6 +37,26 @@ $(document).ready(function() {
});
$('img.js-disabled-action').css({"opacity":0.5});
// change table design for printing
$(window).on('beforeprint', function() {
$('#customer_cart_details thead tr th').each(function(i, val) {
$('#customer_cart_details tbody td:nth-child('+(i+1)+')').each(function () {
let span = $('<span>').addClass('print-class-container')
.append($('<span>').addClass('print-class-title').html($(val).html()))
.append($('<span>').addClass('print-class-content').html(
$(this).html()
)
);
$(this).html($(span).html());
});
});
});
$(window).on('afterprint', function() {
$('#customer_cart_details tbody td').each(function () {
$(this).html($(this).find('span.print-class-content').html());
});
});
});
function stopAjaxQuery() {
@@ -1158,8 +1178,9 @@ function initRoomEvents()
var date_from = tr_product.data('date_from');
var date_to = tr_product.data('date_to');
var id_order_detail = tr_product.data('id_order_detail');
var id_htl_booking = tr_product.data('id_htl_booking');
//var id_order_detail = $(this).closest('.product-line-row').find('td .edit_product_id_order_detail').val();
var query = 'ajax=1&action=deleteRoomLine&token='+token+'&id_order='+id_order+'&id_room='+id_room+'&id_product='+id_product+'&id_hotel='+id_hotel+'&date_from='+date_from+'&date_to='+date_to+'&id_order_detail='+id_order_detail;
var query = 'ajax=1&action=deleteRoomLine&token='+token+'&id_order='+id_order+'&id_htl_booking='+id_htl_booking+'&id_room='+id_room+'&id_product='+id_product+'&id_hotel='+id_hotel+'&date_from='+date_from+'&date_to='+date_to+'&id_order_detail='+id_order_detail;
query += $(this).parent().parent().find('input, select:visible, .edit_product_id_order_detail').serialize();
$.ajax({
type: 'POST',
@@ -1588,6 +1609,7 @@ $(document).ready(function() {
id_order: idOrder,
date_from: dateFrom,
date_to: dateTo,
id_htl_booking: idHtlBooking,
orderEdit: orderEdit,
action: 'getRoomTypeBookingDemands',
ajax: true
@@ -2514,7 +2536,9 @@ const EditRoomBookingModal = {
const dateTo = $.datepicker.formatDate('dd-mm-yy', $.datepicker.parseDate('yy-mm-dd', jsonProductLineData.date_to));
$('#edit_product .edit_product_date_from').attr('value', dateFrom);
$('#edit_product .edit_product_date_from').attr('data-min_date', dateFrom);
$('#edit_product .edit_product_date_to').attr('value', dateTo);
$('#edit_product .edit_product_date_to').attr('data-min_date', dateFrom);
$('#edit_product .edit_product_date_from_actual').attr('value', jsonProductLineData.date_from);
$('#edit_product .edit_product_date_to_actual').attr('value', jsonProductLineData.date_to);
$('#edit_product .room_unit_price').val(parseFloat(jsonProductLineData.paid_unit_price_tax_excl));

View File

@@ -48,4 +48,56 @@ $(document).ready(function() {
}
},
});
$('.change_status').on('click', function (e) {
e.preventDefault();
var id_order_slip = $.trim($(this).closest('tr').find('td[data-key="id_order_slip"]').text());
processupdate(id_order_slip, $(this).attr('href'))
return false;
});
function processupdate(id_order_slip, link)
{
confirmDelete(id_order_slip).then((toUpdate) => {
if (toUpdate) {
window.location = link;
}
});
}
function confirmDelete(id_order_slip)
{
return new Promise((resolve) => {
$.ajax({
type: 'POST',
url: admin_order_slip_tab_link,
dataType: 'JSON',
cache: false,
data: {
ajax: true,
action: 'initSlipStatusModal',
id_order_slip: id_order_slip
},
success: function(result) {
if (result.success && result.modalHtml) {
$('#moduleConfirmUpdate').remove();
$('#footer').next('.bootstrap').append(result.modalHtml);
$('#moduleConfirmUpdate').modal('show');
$('#moduleConfirmUpdate .process_update').click(() => {
resolve(true);
});
$('#moduleConfirmUpdate .btn-close').click(() => {
resolve(false);
});
} else {
resolve(true);
}
},
complete: function() {
$(".loading_overlay").hide();
}
});
});
}
});

View File

@@ -75,7 +75,8 @@ class HotelBookingDemands extends ObjectModel
$groupByRoom = 1,
$getTotalPrice = 0,
$useTax = 1,
$idOrderDetail = 0
$idOrderDetail = 0,
$idHtlBookingDetail = 0
) {
$moduleObj = Module::getInstanceByName('hotelreservationsystem');
$context = Context::getContext();
@@ -89,25 +90,28 @@ class HotelBookingDemands extends ObjectModel
$totalDemandsPrice = 0;
$sql = 'SELECT hb.`id_room`, hb.`adults`, hb.`children`, hd.* FROM `'._DB_PREFIX_.'htl_booking_demands` hd
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hb ON (hd.`id_htl_booking` = hb.`id`)
WHERE hd.`id_htl_booking` IN
(SELECT `id` FROM `'._DB_PREFIX_.'htl_booking_detail`
WHERE `id_order`='.(int) $idOrder;
WHERE hb.`id_order` ='.(int) $idOrder;
if ($idOrderDetail) {
$sql .= ' AND `id_order_detail`='.(int)$idOrderDetail;
}
if ($idProduct) {
$sql .= ' AND `id_product`='.(int)$idProduct;
$sql .= ' AND hb.`id_product`='.(int)$idProduct;
}
if ($idRoom) {
$sql .= ' AND `id_room`='.(int)$idRoom;
$sql .= ' AND hb.`id_room`='.(int)$idRoom;
}
if ($dateFrom && $dateTo) {
$dateFrom = date('Y-m-d', strtotime($dateFrom));
$dateTo = date('Y-m-d', strtotime($dateTo));
$sql .= ' AND `date_from`=\''.pSQL($dateFrom).'\' AND `date_to`= \''.pSQL($dateTo).'\'';
$sql .= ' AND hb.`date_from`=\''.pSQL($dateFrom).'\' AND hb.`date_to`= \''.pSQL($dateTo).'\'';
}
$sql .= ')';
if ($idHtlBookingDetail) {
$sql .= ' AND hb.`id` = '.(int)$idHtlBookingDetail;
}
if ($getTotalPrice) {
$totalDemandsPrice = 0;
}

View File

@@ -3198,7 +3198,10 @@ class HotelBookingDetail extends ObjectModel
$this->id_room,
$this->date_from,
$this->date_to,
0
0,
0,
1,
$this->id
)) {
foreach ($roomDemands as $roomDemand) {
$objHotelBookingDemands = new HotelBookingDemands($roomDemand['id_booking_demand']);

View File

@@ -149,7 +149,9 @@ class HotelOrderRefundRules extends ObjectModel
$objHtlBooking->date_from,
$objHtlBooking->date_to,
1,
1
1,
1,
$objHtlBooking->id
);
$totalServicesPrice = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
@@ -157,7 +159,7 @@ class HotelOrderRefundRules extends ObjectModel
1,
1
);
$paidAmount = $objHtlBooking->total_paid_amount + $totalDemandsPrice + $totalServicesPrice;
$totalAmount = $objHtlBooking->total_price_tax_incl + $totalDemandsPrice + $totalServicesPrice;
if ($refundRules = $objHtlRefundRules->getHotelRefundRules($objHtlBooking->id_hotel, 0, 1)) {
$orderCurrency = $objOrder->id_currency;
@@ -185,7 +187,7 @@ class HotelOrderRefundRules extends ObjectModel
if ($refRule['payment_type'] == HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE) {
$bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE;
$bookingCancellationDetail['cancelation_charge'] = $paidAmount * ($refundValue / 100);
$bookingCancellationDetail['cancelation_charge'] = $totalAmount * ($refundValue / 100);
} else {
$bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_FIXED;
if ($defaultCurrency != $orderCurrency) {
@@ -197,11 +199,6 @@ class HotelOrderRefundRules extends ObjectModel
} else {
$bookingCancellationDetail['cancelation_charge'] = $refundValue;
}
// if deduction amount is more than the order total cost
if ($bookingCancellationDetail['cancelation_charge'] > $paidAmount) {
$bookingCancellationDetail['cancelation_charge'] = $paidAmount;
}
}
$ruleApplied = true;
@@ -210,12 +207,12 @@ class HotelOrderRefundRules extends ObjectModel
}
if (!$ruleApplied) {
$bookingCancellationDetail['cancelation_charge'] = $paidAmount;
$bookingCancellationDetail['cancelation_charge'] = $totalAmount;
$bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE;
$bookingCancellationDetail['reduction_value'] = 100;
}
} else {
$bookingCancellationDetail['cancelation_charge'] = $paidAmount;
$bookingCancellationDetail['cancelation_charge'] = $totalAmount;
$bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE;
$bookingCancellationDetail['reduction_value'] = 100;
}

View File

@@ -832,9 +832,11 @@ class HotelRoomTypeFeaturePricing extends ObjectModel
{
return Db::getInstance()->execute(
'DELETE FROM `'._DB_PREFIX_.'htl_room_type_feature_pricing`
WHERE `id_cart` = '.(int) $id_cart.($id_product ? ' AND `id_product` = '.(int) $id_product.
' AND `id_room` = '.(int) $id_room.' AND `date_from` = "'.pSQL($date_from).
'" AND `date_to` = "'.pSQL($date_to).'"' : '')
WHERE `id_cart` = '.(int) $id_cart.
($id_product ? ' AND `id_product` = '.(int) $id_product : '').
($id_room ? ' AND `id_room` = '.(int) $id_room : '').
($date_from ? ' AND `date_from` = "'.pSQL($date_from) .'"' : '').
($date_to ? ' AND `date_to` = "'.pSQL($date_to) .'"' : '')
);
}

View File

@@ -192,7 +192,9 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
public function getSelectedServicesForRoom(
$idHotelBookingDetail,
$getTotalPrice = 0,
$useTax = null
$useTax = null,
$autoAddToCart = null,
$priceAdditionType = null
) {
if ($useTax === null) {
@@ -212,6 +214,13 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
$sql .= ' WHERE hbd.`id` = '.(int)$idHotelBookingDetail;
if (!is_null($autoAddToCart)) {
$sql .= ' AND od.`product_auto_add` = '. (int)$autoAddToCart;
if ($autoAddToCart == 1 && !is_null($priceAdditionType)) {
$sql .= ' AND od.`product_price_addition_type` = '.$priceAdditionType;
}
}
if ($getTotalPrice) {
$totalPrice = 0;
}

View File

@@ -414,9 +414,11 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
$smartyVars['rms_in_cart'] = $objHotelCartBookingData->getCountRoomsInCart($this->id_cart, $this->id_guest);
$smartyVars['products_in_cart'] = $products_in_cart;
$smartyVars['total_products_in_cart'] = (int)$rms_in_cart + (int)$products_in_cart;
$cartAmountTotal = $this->context->cart->getOrderTotal(false);
$cartRoomsAmount = $this->context->cart->getOrderTotal(false, cart::ONLY_ROOMS) + $this->context->cart->getOrderTotal(false, cart::ONLY_ROOM_SERVICES_WITHOUT_CONVENIENCE_FEE);
$cartAmountConvenienceFee = $this->context->cart->getOrderTotal(false, cart::ONLY_CONVENIENCE_FEE);
$smartyVars['cart_tamount'] = $cartAmountTotal - $cartAmountConvenienceFee;
$smartyVars['cart_rooms_amount'] = $cartRoomsAmount;
$smartyVars['cart_amount_convenience_fee'] = $cartAmountConvenienceFee;
$smartyVars['cart_tamount'] = $cartRoomsAmount + $cartAmountConvenienceFee;
$this->context->smarty->assign($smartyVars);
}

View File

@@ -267,61 +267,65 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
$idRefundState = Tools::getValue('id_refund_state');
if (Validate::isLoadedObject($objRefundState = new OrderReturnState($idRefundState))) {
if ($objRefundState->refunded) {
$refundedAmounts = Tools::getValue('refund_amounts');
if ($hasOrderDiscountOrPayment) {
if ($idsReturnDetail && count($idsReturnDetail)) {
if ($refundedAmounts) {
foreach ($idsReturnDetail as $idRetDetail) {
if (!isset($refundedAmounts[$idRetDetail]) || !Validate::isPrice($refundedAmounts[$idRetDetail])) {
$this->errors[] = $this->l('Invalid refund amount(s) entered.');
if ($idRefundState != $objOrderReturn->state) {
if ($objRefundState->refunded) {
$refundedAmounts = Tools::getValue('refund_amounts');
if ($hasOrderDiscountOrPayment) {
if ($idsReturnDetail && count($idsReturnDetail)) {
if ($refundedAmounts) {
foreach ($idsReturnDetail as $idRetDetail) {
if (!isset($refundedAmounts[$idRetDetail]) || !Validate::isPrice($refundedAmounts[$idRetDetail])) {
$this->errors[] = $this->l('Invalid refund amount(s) entered.');
}
}
} else {
$this->errors[] = $this->l('Invalid refund amount(s) entered.');
}
// If there are no errors in the refund amounts the check validations depends on refund amount
if (!count($this->errors)) {
$totalRefundAmount = array_sum($refundedAmounts);
if (Tools::isSubmit('generateCreditSlip')) {
if ($totalRefundAmount <= 0) {
$this->errors[] = $this->l('Invalid refund amount(s) for generating credit slip.');
}
}
if (Tools::isSubmit('generateDiscount')) {
if ($totalRefundAmount <= 0) {
$this->errors[] = $this->l('Invalid refund amount(s) for generating voucher.');
}
}
if (Tools::isSubmit('refundTransactionAmount')) {
if ($totalRefundAmount <= 0) {
$this->errors[] = $this->l('Invalid refund amount(s) for entering refund transaction details.');
} else {
$paymentMode = Tools::getValue('payment_method');
if (!$paymentMode) {
$paymentMode = Tools::getValue('other_payment_mode');
if (!$paymentMode) {
$this->errors[] = $this->l('Please enter the payment mode of the refund transaction.');
} elseif (!Validate::isGenericName($paymentMode)) {
$this->errors[] = $this->l('Invalid payment mode entered.');
}
}
$idTransaction = Tools::getValue('id_transaction');
if (!$idTransaction) {
$this->errors[] = $this->l('Please enter the transaction id of the refund transaction.');
} elseif (!Validate::isGenericName($idTransaction)) {
$this->errors[] = $this->l('Invalid transaction id entered.');
}
}
}
}
} else {
$this->errors[] = $this->l('Invalid refund amount(s) entered.');
$this->errors[] = $this->l('Select at least one booking for refund.');
}
// If there are no errors in the refund amounts the check validations depends on refund amount
if (!count($this->errors)) {
$totalRefundAmount = array_sum($refundedAmounts);
if (Tools::isSubmit('generateCreditSlip')) {
if ($totalRefundAmount <= 0) {
$this->errors[] = $this->l('Invalid refund amount(s) for generating credit slip.');
}
}
if (Tools::isSubmit('generateDiscount')) {
if ($totalRefundAmount <= 0) {
$this->errors[] = $this->l('Invalid refund amount(s) for generating voucher.');
}
}
if (Tools::isSubmit('refundTransactionAmount')) {
if ($totalRefundAmount <= 0) {
$this->errors[] = $this->l('Invalid refund amount(s) for entering refund transaction details.');
} else {
$paymentMode = Tools::getValue('payment_method');
if (!$paymentMode) {
$paymentMode = Tools::getValue('other_payment_mode');
if (!$paymentMode) {
$this->errors[] = $this->l('Please enter the payment mode of the refund transaction.');
} elseif (!Validate::isGenericName($paymentMode)) {
$this->errors[] = $this->l('Invalid payment mode entered.');
}
}
$idTransaction = Tools::getValue('id_transaction');
if (!$idTransaction) {
$this->errors[] = $this->l('Please enter the transaction id of the refund transaction.');
} elseif (!Validate::isGenericName($idTransaction)) {
$this->errors[] = $this->l('Invalid transaction id entered.');
}
}
}
}
} else {
$this->errors[] = $this->l('Select at least one booking for refund.');
}
}
} else {
$this->errors[] = $this->l('Please select a different refund status.');
}
} else {
$this->errors[] = $this->l('Invalid refund state.');

View File

@@ -261,6 +261,10 @@ p.room_cat_data
font-weight: 600;
font-size: 13px!important;
}
.cart_amt_div .table tbody>tr>td, .cart_amt_div .table tbody>tr>th {
border: none;
padding: 2px 8px;
}
.margin-div
{
@@ -323,7 +327,6 @@ p.room_cat_data
.cart_table_container
{
max-height: 393px;
min-height: 150px;
overflow-y: auto;
}

View File

@@ -69,11 +69,22 @@
<div class="row cart_amt_div">
<table class="table table-responsive">
<tr>
<th colspan="2">{l s='Total Amount (Tax excl.):' mod='hotelreservationsystem'}</th>
<th colspan="2" class="text-right" id="cart_total_amt">
<td>{l s='Rooms Amount (Tax excl.):' mod='hotelreservationsystem'}</td>
<td class="text-right" id="cart_rooms_amount">
{if isset($cart_rooms_amount)}{convertPrice price=$cart_rooms_amount}{else}{convertPrice price=0}{/if}
</td>
</tr>
<tr>
<td>{l s='Convenience Fee (Tax excl.):' mod='hotelreservationsystem'}</td>
<td class="text-right" id="cart_convenience_fee">
{if isset($cart_amount_convenience_fee)}{convertPrice price=$cart_amount_convenience_fee}{else}{convertPrice price=0}{/if}
</td>
</tr>
<tr>
<th>{l s='Total Amount (Tax excl.):' mod='hotelreservationsystem'}</th>
<th class="text-right" id="cart_total_amt">
{if isset($cart_tamount)}{convertPrice price=$cart_tamount}{else}{convertPrice price=0}{/if}
</th>
<th colspan="1"></th>
</tr>
</table>
</div>