-
diff --git a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl
index 1ceb61c62..08fbeaf3e 100644
--- a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl
+++ b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl
@@ -147,7 +147,7 @@
{if (isset($data.extra_demands) && $data.extra_demands) || isset($data.additional_service) && $data.additional_service}
-
+
{l s='Services'}
{/if}
@@ -213,23 +213,14 @@
color:#979797;
font-size:12px;}
/*Extra demands CSS*/
- #rooms_type_extra_demands .modal-header {
- padding-bottom: 0px}
- #rooms_extra_demands {
- font-size: 16px;}
- #rooms_extra_demands .room_demands_container {
- border: 1px solid #ddd;}
- #rooms_extra_demands .demand_header {
- padding: 10px;
- color: #333;
- border-bottom: 1px solid #ddd;}
#rooms_extra_demands .rooms_extra_demands_head {
margin-bottom: 18px;}
#rooms_extra_demands .room_demand_block {
margin-bottom: 15px;
- color: #333;
- font-size: 14px;}
- #rooms_extra_demands .room_demand_detail {
- padding: 15px 15px 0px 15px;}
+ color: #333;}
+ #room_type_service_product_desc #back_to_service_btn {
+ display: none;}
+ #add_new_room_services_block {
+ display: none;}
{/if}
diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl
index 9fcbd69a8..edf6c8cd4 100644
--- a/admin/themes/default/template/controllers/orders/form.tpl
+++ b/admin/themes/default/template/controllers/orders/form.tpl
@@ -177,7 +177,7 @@
$('body').on('click', '.delete_service_product', function(){
if (confirm("{l s='Are you sure?'}"))
{
-
+ $(".loading_overlay").show();
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminOrders')|addslashes}",
@@ -204,7 +204,10 @@
{
alert("l s='Some error occured.please try again.'}");
}
- }
+ },
+ complete: function(){
+ $(".loading_overlay").hide();
+ }
});
$(this).closest("tr").remove();
}
@@ -1499,6 +1502,9 @@
var idRoom = $(this).attr('id_room');
var dateFrom = $(this).attr('date_from');
var dateTo = $(this).attr('date_to');
+ var idHotelCartBooking = $(this).attr('id_hotel_cart_booking');
+
+ $(".loading_overlay").show();
$.ajax({
type: 'POST',
dataType: 'JSON',
@@ -1513,17 +1519,29 @@
id_room: idRoom,
id_cart: idCart,
id_product: idProduct,
+ id_hotel_cart_booking: idHotelCartBooking,
action: 'getRoomTypeCartDemands',
ajax: true
},
success: function(response) {
- if (response.status) {
- $('#customer_cart_details').after(response.html_exta_demands);
+ if (response.hasError) {
+ var errorHtml = error_found_txt + ':
';
+ errorHtml += '
';
+ $.each(response.errors, function(key, errorMsg) {
+ errorHtml += '' + errorMsg + ' ';
+ });
+ errorHtml += ' ';
+ showErrorMessage(errorHtml);
+ } else {
+ $('#customer_cart_details').after(response.html_exta_demands);
// $('#rooms_type_extra_demands').find('#room_type_demands_desc').html('');
// $('#rooms_type_extra_demands').find('#room_type_demands_desc').append(response.html_exta_demands);
$('#rooms_type_extra_demands').modal('show');
- }
+ }
},
+ complete: function() {
+ $(".loading_overlay").hide();
+ }
});
});
$(document).on('hidden.bs.modal', '#rooms_type_extra_demands', function (e) {
@@ -1542,6 +1560,7 @@
});
});
var idBookingCart = $(this).attr('id_cart_booking');
+ $(".loading_overlay").show();
$.ajax({
type: 'POST',
dataType: 'JSON',
@@ -1563,7 +1582,10 @@
} else {
showErrorMessage(txtExtraDemandErr);
}
- }
+ },
+ complete: function() {
+ $(".loading_overlay").hide();
+ }
});
});
@@ -1584,6 +1606,7 @@
});
});
var idBookingCart = $(this).closest('.room_demand_block').find('.id_room_type_demand').attr('id_cart_booking');
+ $(".loading_overlay").show();
$.ajax({
type: 'POST',
dataType: 'JSON',
@@ -1605,25 +1628,14 @@
} else {
showErrorMessage(txtExtraDemandErr);
}
- }
+ },
+ complete: function() {
+ $(".loading_overlay").hide();
+ }
});
}
});
- $(document).on('click', '.change_room_type_service_product', function() {
- updateServiceProducts(this);
- });
-
- $(document).on('focusout', '#rooms_type_extra_demands .qty', function(e) {
- var qty_wntd = $(this).val();
- if (qty_wntd == '' || !$.isNumeric(qty_wntd)) {
- $(this).val(1);
- }
- if ($(this).closest('.room_demand_block').find('.change_room_type_service_product').is(':checked')) {
- updateServiceProducts($(this).closest('.room_demand_block').find('.change_room_type_service_product'));
- }
- });
-
$(document).on('keyup', '#payment_module_name', function() {
let paymentMethod = $('#payment_module_name').val().trim().toLowerCase();
@@ -1682,15 +1694,42 @@
}
});
- function updateServiceProducts(element)
- {
- var operator = $(element).is(':checked') ? 'up' : 'down';
- var id_product = $(element).val();
- var id_cart_booking = $(element).data('id_cart_booking');
- var qty = $(element).closest('.room_demand_block').find('input.qty').val();
- if (typeof(qty) == 'undefined') {
- qty = 1;
+ // click on back button on created facilities while additional facilities edit
+ $(document).on('click', '#back_to_service_btn', function() {
+ $('#room_type_services_desc').show();
+ $('#add_new_room_services_block').hide();
+ $('#back_to_service_btn').hide();
+ });
+
+ // Add new custom service: Show hide new custom service form
+ $(document).on('click', '#btn_new_room_service', function() {
+ $('#add_new_room_services_block').show();
+ $('#back_to_service_btn').show();
+ $('#room_type_services_desc').hide();
+ });
+
+ // Add new custom service: change auto added option
+ $(document).on('change', '#add_new_room_services_form input[name="new_service_auto_added"]', function() {
+ var room_type_tax_rule_group_exist = $("#room_type_tax_rule_group_exist").val();
+ if ($(this).val() == 1) {
+ $("#new_service_price_tax_rule_container").hide();
+ $("#new_service_price_addition_type_container").show();
+ $("#new_service_qty_container").hide();
+ } else {
+ $("#new_service_price_addition_type_container").hide();
+ $("#new_service_qty_container").show();
+ $("#new_service_price_tax_rule_container").show();
}
+ });
+
+ // Add new custom service to the room
+ $(document).on('submit', '#add_new_room_services_form', function(e) {
+ e.preventDefault();
+ var form_data = new FormData(this);
+ form_data.append('ajax', true);
+ form_data.append('action', 'addNewRoomServices');
+
+ $(".loading_overlay").show();
$.ajax({
type: 'POST',
headers: {
@@ -1699,25 +1738,80 @@
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
dataType: 'JSON',
cache: false,
- data: {
- operator: operator,
- id_product: id_product,
- id_cart_booking: id_cart_booking,
- qty: qty,
- action: 'updateServiceProduct',
- ajax: true
- },
+ data: form_data,
+ processData: false,
+ contentType: false,
success: function(jsonData) {
if (!jsonData.hasError) {
+ if (jsonData.service_panel) {
+ $('#room_type_service_product_desc').replaceWith(jsonData.service_panel);
+ }
showSuccessMessage(txtExtraDemandSucc);
} else {
- showErrorMessage(jsonData.errors);
-
+ var errorHtml = error_found_txt + ':
';
+ errorHtml += '
';
+ $.each(jsonData.errors, function(key, errorMsg) {
+ errorHtml += '' + errorMsg + ' ';
+ });
+ errorHtml += ' ';
+ showErrorMessage(errorHtml);
}
+ },
+ complete: function() {
+ $(".loading_overlay").hide();
}
});
+ });
- }
+ $(document).on('click', '.change_room_type_service_product', function() {
+ if ($(this).prop('checked')) {
+ $("#selected_service_product_"+$(this).val()).val(1);
+ } else {
+ $("#selected_service_product_"+$(this).val()).val(0);
+ }
+ });
+
+ $(document).on('submit', '#update_selected_room_services_form', function(e) {
+ e.preventDefault();
+ var form_data = new FormData(this);
+ form_data.append('ajax', true);
+ form_data.append('action', 'updateSelectedRoomServices');
+
+ $(".loading_overlay").show();
+ $.ajax({
+ type: 'POST',
+ headers: {
+ "cache-control": "no-cache"
+ },
+ url: "{$link->getAdminLink('AdminCarts')|addslashes}",
+ dataType: 'JSON',
+ cache: false,
+ data: form_data,
+ processData: false,
+ contentType: false,
+ success: function(jsonData) {
+ if (!jsonData.hasError) {
+ if (jsonData.service_panel) {
+ $('#room_type_service_product_desc').replaceWith(jsonData.service_panel);
+ }
+ showSuccessMessage(txtExtraDemandSucc);
+ } else {
+ if (jsonData.errors != 'undefined' && jsonData.errors.length) {
+ var errorHtml = error_found_txt + ':
';
+ errorHtml += '
';
+ $.each(jsonData.errors, function(key, errorMsg) {
+ errorHtml += '' + errorMsg + ' ';
+ });
+ errorHtml += ' ';
+ showErrorMessage(errorHtml);
+ }
+ }
+ },
+ complete: function() {
+ $(".loading_overlay").hide();
+ }
+ });
+ });
});
@@ -2299,8 +2393,7 @@
{addJsDefL name='max_children_txt'}{l s='Maximum children occupancy reached' js=1}{/addJsDefL}
{addJsDefL name='no_children_allowed_txt'}{l s='Only adults can be accommodated' js=1}{/addJsDefL}
{addJsDefL name='invalid_occupancy_txt'}{l s='Invalid occupancy(adults/children) found.' js=1}{/addJsDefL}
-
-
+ {addJsDefL name='error_found_txt'}{l s='Errors found' js=1}{/addJsDefL}
{/strip}
diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl
index 6c6a4071a..eff61f2de 100644
--- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl
+++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl
@@ -1275,5 +1275,6 @@
{addJsDefL name=txt_booking_document_upload_success}{l s='Document uploaded successfully.' js=1}{/addJsDefL}
{addJsDefL name=txt_booking_document_delete_confirm}{l s='Are you sure?' js=1}{/addJsDefL}
{addJsDefL name=txt_booking_document_delete_success}{l s='Document deleted successfully.' js=1}{/addJsDefL}
+ {addJsDefL name='error_found_txt'}{l s='Errors found' js=1}{/addJsDefL}
{/strip}
{/block}
diff --git a/admin/themes/default/template/controllers/orders/modals/_add_order_extra_services_tab_content.tpl b/admin/themes/default/template/controllers/orders/modals/_add_order_extra_services_tab_content.tpl
new file mode 100644
index 000000000..768510abc
--- /dev/null
+++ b/admin/themes/default/template/controllers/orders/modals/_add_order_extra_services_tab_content.tpl
@@ -0,0 +1,179 @@
+{*
+* 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
+* @copyright Since 2010 Webkul IN
+* @license https://store.webkul.com/license.html
+*}
+
+
+ {if $customServiceAllowed}
+
+ {l s='Add a new service'}
+ {l s='Back'}
+
+
+ {/if}
+ {if isset($serviceProducts) && $serviceProducts}
+
+ {assign var=roomCount value=1}
+
+
+ {if isset($serviceProducts) && $serviceProducts}
+
+ {/if}
+
+
+
+ {/if}
+
+ {if $customServiceAllowed}
+
+ {/if}
+
diff --git a/admin/themes/default/template/controllers/orders/modals/_extra_services_service_products_tab_content.tpl b/admin/themes/default/template/controllers/orders/modals/_extra_services_service_products_tab_content.tpl
index ffeba9c2c..01bfc973e 100644
--- a/admin/themes/default/template/controllers/orders/modals/_extra_services_service_products_tab_content.tpl
+++ b/admin/themes/default/template/controllers/orders/modals/_extra_services_service_products_tab_content.tpl
@@ -20,82 +20,96 @@