update fixed issues for quickservice from sqa
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
$(function() {
|
||||
var role = $('#role').val();
|
||||
type = $('#type').val();
|
||||
modify_order = $('#modify_order').val();
|
||||
type = window.location.href.indexOf("quick_service");
|
||||
modify_order = window.location.href.indexOf("modify_order");
|
||||
//click menu sidebar menu category
|
||||
$(".product").on("click", function(){
|
||||
var url = $(this).attr('data-ref');
|
||||
@@ -88,13 +88,16 @@ $(function() {
|
||||
function show_menu_item_list(url_item){
|
||||
var menu_list = $('.menu_items_list');
|
||||
menu_list.empty();
|
||||
|
||||
if (modify_order=="true" && type =="true") {
|
||||
url_item = '../../../addorders/'+url_item;
|
||||
}if(modify_order=="false" && type =="true"){
|
||||
url_item = 'addorders/'+url_item
|
||||
}else{
|
||||
url_item = url_item;
|
||||
|
||||
type = window.location.href.indexOf("quick_service");
|
||||
modify_order = window.location.href.indexOf("modify_order");
|
||||
if (type != -1 && modify_order != -1) {
|
||||
url_item = '../../../addorders/'+url_item;
|
||||
}if(modify_order == -1 && type != -1){
|
||||
url_item = 'addorders/'+url_item;
|
||||
}
|
||||
if (type ==-1 && modify_order == -1){
|
||||
url_item = url_item
|
||||
}
|
||||
|
||||
//Start Ajax
|
||||
@@ -104,8 +107,6 @@ $(function() {
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
console.log(data);
|
||||
console.log("ememem")
|
||||
var menu_items_list = $('.menu_items_list');
|
||||
menu_items_list.empty();
|
||||
menu_items = data.menu_items;
|
||||
@@ -758,14 +759,10 @@ $(function() {
|
||||
e.preventDefault();
|
||||
$("#oqs_loading_wrapper").show();
|
||||
|
||||
type = $('#type').val();
|
||||
if (type == 'true') {
|
||||
// if (role == 'waiter') {
|
||||
type = 'quick_service'
|
||||
// }else{
|
||||
// type = 'cashier'
|
||||
// }
|
||||
type = window.location.href.indexOf("quick_service");
|
||||
|
||||
if (type != 'true') {
|
||||
type = 'quick_service'
|
||||
var table_type = $('#table_type').text();
|
||||
var table_id = $('#table_id').val();
|
||||
var customer_id = $('#customer_id').val();
|
||||
@@ -785,15 +782,15 @@ $(function() {
|
||||
var params = {'order_source': type, 'order_type': "dine_in",
|
||||
'customer_id': customer_id, 'guest_info': "",'booking_id':booking_id,
|
||||
'table_id': table_id,
|
||||
'order_items': order_items };
|
||||
'order_items': order_items,'create_type' : "create_only" };
|
||||
}else{
|
||||
var params = {'order_source': type, 'order_type': "dine_in",
|
||||
'customer_id': customer_id, 'guest_info': "",
|
||||
'table_id': table_id,
|
||||
'order_items': order_items };
|
||||
'order_items': order_items,'create_type' : "create_only" };
|
||||
}
|
||||
|
||||
if (table_id.length>0 || role == 'waiter') {
|
||||
|
||||
// if (table_id.length>0 || role == 'waiter') {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
@@ -812,12 +809,12 @@ $(function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$(this).removeAttr('disabled', '');
|
||||
$("#oqs_loading_wrapper").hide();
|
||||
// }else{
|
||||
// $(this).removeAttr('disabled', '');
|
||||
// $("#oqs_loading_wrapper").hide();
|
||||
|
||||
swal("Opps","Please Select Table or Room","warning");
|
||||
}
|
||||
// swal("Opps","Please Select Table or Room","warning");
|
||||
// }
|
||||
});
|
||||
|
||||
|
||||
@@ -826,9 +823,10 @@ $(function() {
|
||||
$(this).attr('disabled', 'disabled');
|
||||
e.preventDefault();
|
||||
type = "quick_service"
|
||||
modify_order = window.location.href.indexOf("modify_order");
|
||||
$("#oqs_loading_wrapper").show();
|
||||
console.log(modify_order)
|
||||
if (modify_order == "true") {
|
||||
if (modify_order !=-1) {
|
||||
console.log($('#sale_id').text())
|
||||
var ajax_url = '../../../quick_service/update_modify_order';
|
||||
var table_type = $('#table_type').text();
|
||||
@@ -850,12 +848,12 @@ $(function() {
|
||||
var params = {'order_source': type, 'order_type': "dine_in",
|
||||
'customer_id': customer_id, 'guest_info': "",'booking_id':booking_id,
|
||||
'table_id': table_id,
|
||||
'order_items': order_items,'sale_id': sale_id };
|
||||
'order_items': order_items,'sale_id': sale_id,'create_type': "create_pay" };
|
||||
}else{
|
||||
var params = {'order_source': type, 'order_type': "dine_in",
|
||||
'customer_id': customer_id, 'guest_info': "",
|
||||
'table_id': table_id,
|
||||
'order_items': order_items,'sale_id': sale_id };
|
||||
'order_items': order_items,'sale_id': sale_id,'create_type': "create_pay" };
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
@@ -987,7 +985,7 @@ $(function() {
|
||||
$("#back").on("click", function(){
|
||||
var table_id = $('#table_id').text();
|
||||
var table_type = $('#table_type').text();
|
||||
type = $('#type').val();
|
||||
type = window.location.href.indexOf("quick_service");
|
||||
if (type == 'true') {
|
||||
var table_type = $('#table_id').find("option:selected").data('type');
|
||||
var table_id = $('#table_id').val();
|
||||
@@ -1113,11 +1111,12 @@ $(function() {
|
||||
//show menu item list when click menu category
|
||||
function show_sub_category_list(url,sub_category){
|
||||
|
||||
if (modify_order == "true" && type =="true") {
|
||||
if (type != -1 && modify_order != -1) {
|
||||
var url = "../../../addorders/"+url;
|
||||
}if(modify_order=="false" && type =="true"){
|
||||
}if(modify_order== -1 && type != -1){
|
||||
var url = 'addorders/'+url;
|
||||
}else{
|
||||
}
|
||||
if (type ==-1 && modify_order == -1){
|
||||
var url = url;
|
||||
}
|
||||
|
||||
@@ -1130,8 +1129,6 @@ $(function() {
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
console.log(data)
|
||||
console.log("ffffffffff")
|
||||
var sub_category_list = $('.sub_category_list');
|
||||
sub_category_list.empty();
|
||||
data = data.sub_category;
|
||||
|
||||
@@ -175,7 +175,7 @@ section.content{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.add_icon{
|
||||
.menu_item_box{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user