fix table booking

This commit is contained in:
Thein Lin Kyaw
2020-08-18 17:30:27 +06:30
parent 7aef3d7bac
commit 590b0aac3b
3 changed files with 35 additions and 31 deletions

View File

@@ -831,6 +831,7 @@
var sale_id = this.id;
window.location.href = '/origami/table/' + dining_id + "/table_invoice/" + sale_id;
})
$(".tables").on('click', function () {
localStorage.setItem('dinning_type','table');
var customer_id = $(".customer-id").text();
@@ -1156,32 +1157,35 @@
})
$('#add_invoice').on('click', function () {
$("#first_bill").prop('disabled',true);
$("#pay").prop('disabled',true);
var dining_id = "<%= @dining.id %>";
var sale_id = $("#sale_id").val(); //<%= @obj_sale.sale_id rescue "" %>
var ajax_url = "/origami/sale/append_order";
// var tax_type = localStorage.getItem("tax_type");
var tax_type = $("#check_tax").val();
$.ajax({
type: "POST",
url: ajax_url,
data: 'dining_id=' + dining_id + "&sale_id=" + sale_id + "&tax_type=" + tax_type,
success: function (result) {
swal({
title: "Information!",
text: "Invoice updated",
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
$("#first_bill").removeAttr('disabled');
$("#pay").removeAttr('disabled');
window.location.reload();
});
}
});
$("#loading_wrapper").show();
$("#add_invoice").prop('disable', true);
$("#first_bill").prop('disabled',true);
$("#pay").prop('disabled',true);
var dining_id = "<%= @dining.id %>";
var sale_id = $("#sale_id").val(); //<%= @obj_sale.sale_id rescue "" %>
var ajax_url = "/origami/sale/append_order";
// var tax_type = localStorage.getItem("tax_type");
var tax_type = $("#check_tax").val();
$.ajax({
type: "POST",
url: ajax_url,
data: 'dining_id=' + dining_id + "&sale_id=" + sale_id + "&tax_type=" + tax_type,
success: function (result) {
swal({
title: "Information!",
text: "Invoice updated",
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
$("#first_bill").removeAttr('disabled');
$("#pay").removeAttr('disabled');
window.location.reload();
});
$("#loading_wrapper").hide();
}
});
})
//show cusotmer rebate amount