diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index e098a0e0..acd3c914 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -37,7 +37,7 @@
- <% @tables.each do |table| %> + <% @tables.each do |table| %> <% if table.status == 'occupied' %> <% if table.get_booking.nil? %> @@ -316,7 +316,7 @@ - <% if @dining.bookings.length >= 1 %> + <% if @dining.bookings.length >= 1 %> <% if @status_order == 'order' && @status_sale != 'sale' %> @@ -583,8 +583,18 @@ confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, void it!", closeOnConfirm: false - }, function () { - window.location.href = '/origami/'; + }, function (isConfirm) { + if (isConfirm) { + var sale_id = "<%= @obj_sale.sale_id rescue "" %>" + var ajax_url = "/origami/sale/" + sale_id + '/void'; + $.ajax({ + type: 'POST', + url: ajax_url, + success: function () { + window.location.href = '/origami/'; + } + }); + } }); });