add to existing order

This commit is contained in:
Myat Zin Wai Maw
2019-12-18 10:15:24 +06:30
parent 8af99742a3
commit 16485875c1
10 changed files with 119 additions and 111 deletions

View File

@@ -1655,4 +1655,32 @@ $(function() {
//end is_sub_item false
}
}
$("#add_to_existing_order").on('click', function(e){
$(this).attr('disabled', 'disabled');
e.preventDefault();
type = $("#link_type").val();
$("#oqs_loading_wrapper").show();
var ajax_url = 'addorders/add_to_existing_order';
var table_type = $('#table_type').text();
var table_id = $('#table_id').text();
var customer_id = $('#customer_id').text();
var booking_id = $('#booking_id').text();
var sale_id = $('#sale_id').text();
var order_items = JSON.stringify(get_order_item_rows());
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,'create_type': "create_pay" };
$.ajax({
type: "POST",
url: ajax_url,
data: params,
dataType: "json",
success:function(result){
if (result.status) {
window.location.href = "/foodcourt/table/sale/" + sale_id + "/food_court/edit";
}
}
});
});
});