app
This commit is contained in:
@@ -59,7 +59,7 @@ class Foodcourt::OrdersController < BaseFoodcourtController
|
|||||||
.joins(" JOIN booking_orders ON booking_orders.booking_id=bookings.booking_id")
|
.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 orders ON orders.order_id=booking_orders.order_id")
|
||||||
.joins("JOIN customers ON orders.customer_id=customers.customer_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
|
@customer_id =@booking.customer_id
|
||||||
@booking_id =@booking.booking_id
|
@booking_id =@booking.booking_id
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -30,22 +30,27 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<div id="custom-slimscroll">
|
<div id="custom-slimscroll">
|
||||||
<div class="card-columns">
|
<div class="card-columns">
|
||||||
<% bk_status ='' %>
|
<% bk_color ='' %>
|
||||||
|
|
||||||
<% @bookings.each do |bk|
|
<% @bookings.each do |bk|
|
||||||
|
bk_status ='completed'
|
||||||
|
if bk.booking_status =='assign'
|
||||||
|
bk_status ='new'
|
||||||
|
end
|
||||||
if !@booking.nil?
|
if !@booking.nil?
|
||||||
if bk.booking_id == @booking.booking_id
|
if bk.booking_id == @booking.booking_id
|
||||||
bk_status ='bg-red'
|
bk_color ='bg-red'
|
||||||
else
|
else
|
||||||
bk_status =bk.booking_status
|
bk_color =bk.booking_status
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
bk_status =bk.booking_status
|
bk_color =bk.booking_status
|
||||||
end %>
|
end %>
|
||||||
<%= link_to foodcourt_app_order_by_booking_path(booking_id:bk.booking_id) do %>
|
<%= 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">
|
<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>
|
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>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -123,11 +128,11 @@
|
|||||||
$('#done_order').on('click', function () {
|
$('#done_order').on('click', function () {
|
||||||
swal({
|
swal({
|
||||||
title: "Alert !",
|
title: "Alert !",
|
||||||
text: 'This order is really done!',
|
text: 'Order Complete?',
|
||||||
type: "warning",
|
type: "warning",
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
confirmButtonColor: "#DD6B55",
|
confirmButtonColor: "#DD6B55",
|
||||||
confirmButtonText: "Yes!",
|
confirmButtonText: "Yes",
|
||||||
cancelButtonClass: 'btn btn-danger',
|
cancelButtonClass: 'btn btn-danger',
|
||||||
closeOnConfirm: false
|
closeOnConfirm: false
|
||||||
}, function (isConfirm) {
|
}, function (isConfirm) {
|
||||||
@@ -139,7 +144,13 @@
|
|||||||
data: {customer_id:"<%=@customer_id %>"},
|
data: {customer_id:"<%=@customer_id %>"},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
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 %>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -427,9 +427,6 @@
|
|||||||
|
|
||||||
<% if (@cashier_type=="quick_service" || @cashier_type=="food_court") && @sale_payment.nil? %>
|
<% if (@cashier_type=="quick_service" || @cashier_type=="food_court") && @sale_payment.nil? %>
|
||||||
<hr>
|
<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" %>
|
<% 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>
|
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="edit">Edit</a>
|
||||||
<% else %>
|
<% else %>
|
||||||
@@ -1388,6 +1385,7 @@ $(document).ready(function(){
|
|||||||
url: "/foodcourt/payment/"+cashier_type+"/foc",
|
url: "/foodcourt/payment/"+cashier_type+"/foc",
|
||||||
data: params,
|
data: params,
|
||||||
success:function(result){
|
success:function(result){
|
||||||
|
$('#focModal').modal('hide');
|
||||||
customer_display_view(null,"reload");
|
customer_display_view(null,"reload");
|
||||||
if (cash >= 0) {
|
if (cash >= 0) {
|
||||||
swal({
|
swal({
|
||||||
|
|||||||
Reference in New Issue
Block a user