diff --git a/app/controllers/foodcourt/orders_controller.rb b/app/controllers/foodcourt/orders_controller.rb index 412233b8..0349356a 100755 --- a/app/controllers/foodcourt/orders_controller.rb +++ b/app/controllers/foodcourt/orders_controller.rb @@ -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 diff --git a/app/views/foodcourt/orders/app_orders.html.erb b/app/views/foodcourt/orders/app_orders.html.erb index e90d6307..0ff8af0f 100644 --- a/app/views/foodcourt/orders/app_orders.html.erb +++ b/app/views/foodcourt/orders/app_orders.html.erb @@ -30,22 +30,27 @@ <% end %>
- <% 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 %> -
+
Cus Ph :<%= bk.contact_no %>Order Time :<%= bk.checkin_at.utc.getlocal.strftime("%I:%M %p") %>
- BK :<%= bk.booking_id %> + BK :<%= bk.booking_id %><%= bk_status %>
<% 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 %>"; + } } }); } diff --git a/app/views/foodcourt/payments/show.html.erb b/app/views/foodcourt/payments/show.html.erb index e97ef097..336c7a2d 100755 --- a/app/views/foodcourt/payments/show.html.erb +++ b/app/views/foodcourt/payments/show.html.erb @@ -427,9 +427,6 @@ <% if (@cashier_type=="quick_service" || @cashier_type=="food_court") && @sale_payment.nil? %>
- - - <% if current_login_employee.role == "cashier" %> Edit <% 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({