This commit is contained in:
Myat Zin Wai Maw
2019-12-04 14:18:37 +06:30
parent 0b98f3a149
commit 6c1b6fe79f
3 changed files with 22 additions and 13 deletions

View File

@@ -59,7 +59,7 @@ class Foodcourt::OrdersController < BaseFoodcourtController
.joins(" JOIN booking_orders ON booking_orders.booking_id=bookings.booking_id")
.joins("JOIN orders ON orders.order_id=booking_orders.order_id")
.joins("JOIN customers ON orders.customer_id=customers.customer_id")
.where("orders.source='app' and bookings.shop_code='#{@shop.shop_code}' and bookings.booking_id='#{params[:booking_id]}'").first
.where("orders.source='app' and bookings.booking_id='#{params[:booking_id]}'").first
@customer_id =@booking.customer_id
@booking_id =@booking.booking_id
end

View File

@@ -30,22 +30,27 @@
<% end %>
<div id="custom-slimscroll">
<div class="card-columns">
<% bk_status ='' %>
<% bk_color ='' %>
<% @bookings.each do |bk|
bk_status ='completed'
if bk.booking_status =='assign'
bk_status ='new'
end
if !@booking.nil?
if bk.booking_id == @booking.booking_id
bk_status ='bg-red'
bk_color ='bg-red'
else
bk_status =bk.booking_status
bk_color =bk.booking_status
end
else
bk_status =bk.booking_status
bk_color =bk.booking_status
end %>
<%= link_to foodcourt_app_order_by_booking_path(booking_id:bk.booking_id) do %>
<div class="card <%= bk_status %> text-white" data-id ="<%= bk.booking_id %>">
<div class="card <%= bk_color %> text-white" data-id ="<%= bk.booking_id %>">
<div class="card-block">
Cus Ph :<%= bk.contact_no %><span style="font-size:12px;float:right;line-height:inherit;">Order Time :<%= bk.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span><br>
BK :<%= bk.booking_id %>
BK :<%= bk.booking_id %><span style="font-size:12px;float:right;line-height:inherit;"><%= bk_status %></span>
</div>
</div>
<% end %>
@@ -123,11 +128,11 @@
$('#done_order').on('click', function () {
swal({
title: "Alert !",
text: 'This order is really done!',
text: 'Order Complete?',
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes!",
confirmButtonText: "Yes",
cancelButtonClass: 'btn btn-danger',
closeOnConfirm: false
}, function (isConfirm) {
@@ -139,7 +144,13 @@
data: {customer_id:"<%=@customer_id %>"},
dataType: "json",
success: function(data) {
window.location.href ="<%=foodcourt_app_order_by_booking_path %>";
swal({
title: "Information!",
text: 'Send sms to customer ',
type: "success",
}, function () {
window.location.href ="<%=foodcourt_app_order_by_booking_path %>";
}
}
});
}

View File

@@ -427,9 +427,6 @@
<% if (@cashier_type=="quick_service" || @cashier_type=="food_court") && @sale_payment.nil? %>
<hr>
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect" >Customer</button>
<% if current_login_employee.role == "cashier" %>
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="edit">Edit</a>
<% else %>
@@ -1388,6 +1385,7 @@ $(document).ready(function(){
url: "/foodcourt/payment/"+cashier_type+"/foc",
data: params,
success:function(result){
$('#focModal').modal('hide');
customer_display_view(null,"reload");
if (cash >= 0) {
swal({