split bill

This commit is contained in:
phyusin
2018-02-01 18:12:59 +06:30
parent ee17ddac92
commit 48ce8e4809
9 changed files with 846 additions and 15 deletions

View File

@@ -670,22 +670,36 @@
// Bill Request
$('#request_bills').click(function () {
var order_id = $('#save_order_id').attr('data-order');
var ajax_url = "/origami/" + order_id + "/request_bills";
$.ajax({
type: "GET",
url: ajax_url,
// data: 'order_id='+ order_id,
success: function (result) {
if (!result.status) {
swal("Information!", result.error_message);
swal({
title: "Alert",
text: "Are you sure want to Split?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, split it!",
closeOnConfirm: false
}, function (isConfirm) {
if (isConfirm) {
var dining_id = "<%= @dining.id %>";
window.location.href = '/origami/table/' + dining_id + "/split_bill";
}else{
var order_id = $('#save_order_id').attr('data-order');
var ajax_url = "/origami/" + order_id + "/request_bills";
$.ajax({
type: "GET",
url: ajax_url,
// data: 'order_id='+ order_id,
success: function (result) {
if (!result.status) {
swal("Information!", result.error_message);
}
else {
location.reload();
}
}
else {
location.reload();
}
}
});
});
}
});
});
$('#move').on('click', function () {